summaryrefslogtreecommitdiffstats
path: root/core/views.py
diff options
context:
space:
mode:
Diffstat (limited to 'core/views.py')
-rw-r--r--core/views.py37
1 files changed, 36 insertions, 1 deletions
diff --git a/core/views.py b/core/views.py
index 30eaf90..2ef83cc 100644
--- a/core/views.py
+++ b/core/views.py
@@ -1,4 +1,6 @@
-from django.views.generic import TemplateView
+from django.http import JsonResponse
+from django.templatetags.static import static
+from django.views.generic import TemplateView, View
from activities.views.timelines import Home
from users.models import Identity
@@ -19,3 +21,36 @@ class LoggedOutHomepage(TemplateView):
return {
"identities": Identity.objects.filter(local=True),
}
+
+
+class AppManifest(View):
+ """
+ Serves a PWA manifest file. This is a view as we want to drive some
+ items from settings.
+ """
+
+ def get(self, request):
+ return JsonResponse(
+ {
+ "$schema": "https://json.schemastore.org/web-manifest-combined.json",
+ "name": "Takahē",
+ "short_name": "Takahē",
+ "start_url": "/",
+ "display": "standalone",
+ "background_color": "#26323c",
+ "theme_color": "#26323c",
+ "description": "An ActivityPub server",
+ "icons": [
+ {
+ "src": static("img/icon-128.png"),
+ "sizes": "128x128",
+ "type": "image/png",
+ },
+ {
+ "src": static("img/icon-1024.png"),
+ "sizes": "1024x1024",
+ "type": "image/png",
+ },
+ ],
+ }
+ )