Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add: installable as PWA #2981

Merged
merged 6 commits into from
Oct 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions bookwyrm/templates/embed-layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
<base target="_blank">

<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}{% endif %}">
<link rel="manifest" href="/manifest.json" />
</head>
<body>

Expand Down
1 change: 1 addition & 0 deletions bookwyrm/templates/layout.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

<link rel="shortcut icon" type="image/x-icon" href="{% if site.favicon %}{% get_media_prefix %}{{ site.favicon }}{% else %}{% static "images/favicon.ico" %}{% endif %}">
<link rel="apple-touch-icon" href="{% if site.logo %}{{ media_full_url }}{{ site.logo }}{% else %}{% static "images/logo.png" %}{% endif %}">
<link rel="manifest" href="/manifest.json" />

{% block opengraph %}
{% include 'snippets/opengraph.html' %}
Expand Down
14 changes: 14 additions & 0 deletions bookwyrm/templates/manifest.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{% load static %}
{
"name": "{{ site.name }}",
"description": "{{ site.description }}",
"icons": [
{
"src": "{% if site.logo %}{{ media_full_url }}{{ site.logo }}{% else %}{% static 'images/logo.png' %}{% endif %}",
"type": "image/png",
"sizes": "512x512"
}
],
"start_url": "/",
"display": "standalone"
}
6 changes: 6 additions & 0 deletions bookwyrm/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@
"robots.txt",
TemplateView.as_view(template_name="robots.txt", content_type="text/plain"),
),
path(
"manifest.json",
TemplateView.as_view(
template_name="manifest.json", content_type="application/json"
),
),
# federation endpoints
re_path(r"^inbox/?$", views.Inbox.as_view(), name="inbox"),
re_path(rf"{LOCAL_USER_PATH}/inbox/?$", views.Inbox.as_view(), name="user_inbox"),
Expand Down