mirror of
https://github.com/bookwyrm-social/bookwyrm.git
synced 2024-11-22 09:31:08 +00:00
Merge pull request #2981 from rg-wood/installable-pwa
Add: installable as PWA Resolves #2558
This commit is contained in:
commit
6667178703
4 changed files with 22 additions and 0 deletions
|
@ -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>
|
||||
|
||||
|
|
|
@ -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' %}
|
||||
|
|
14
bookwyrm/templates/manifest.json
Normal file
14
bookwyrm/templates/manifest.json
Normal file
|
@ -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"
|
||||
}
|
|
@ -34,6 +34,12 @@ urlpatterns = [
|
|||
"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"),
|
||||
|
|
Loading…
Reference in a new issue