Ajout manifest.json pour icônes raccourcis

This commit is contained in:
Claude Paroz 2025-09-08 19:40:14 +02:00
parent 161399d33d
commit 6d499815e6
8 changed files with 382 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 124 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 58 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 88 KiB

View file

@ -21,6 +21,11 @@ class HomeView(TemplateView):
} }
class ManifestView(TemplateView):
template_name = "manifest.json"
content_type = "application/json"
class PresentationView(TemplateView): class PresentationView(TemplateView):
template_name="presentation.html" template_name="presentation.html"

View file

@ -1,10 +1,14 @@
from django.contrib import admin from django.contrib import admin
from django.urls import include, path from django.urls import include, path
from django.views.decorators.cache import cache_page
from django.views.generic import TemplateView from django.views.generic import TemplateView
from beesgospel import views from beesgospel import views
urlpatterns = [ urlpatterns = [
path("manifest.json",
cache_page(3600 * 24)(views.ManifestView.as_view()), name="manifest"
),
path("admin/", admin.site.urls), path("admin/", admin.site.urls),
path("accounts/", include("django.contrib.auth.urls")), path("accounts/", include("django.contrib.auth.urls")),
path("", views.HomeView.as_view(), name="home"), path("", views.HomeView.as_view(), name="home"),

View file

@ -6,6 +6,7 @@
<title>Le Gospel de lAbeille - Bee's Gospel{% block page_title %}{% endblock %}</title> <title>Le Gospel de lAbeille - Bee's Gospel{% block page_title %}{% endblock %}</title>
<link href="{% static 'vendor/bootstrap.min.css' %}" rel="stylesheet"> <link href="{% static 'vendor/bootstrap.min.css' %}" rel="stylesheet">
<link href="{% static 'css/main.css' %}" rel="stylesheet"> <link href="{% static 'css/main.css' %}" rel="stylesheet">
<link rel="manifest" href="{% url 'manifest' %}" crossorigin="use-credentials">
<script src="{% static 'vendor/bootstrap.bundle.min.js' %}"></script> <script src="{% static 'vendor/bootstrap.bundle.min.js' %}"></script>
</head> </head>
<body class="{% block bodyclass %}{% endblock %}"> <body class="{% block bodyclass %}{% endblock %}">

26
templates/manifest.json Normal file
View file

@ -0,0 +1,26 @@
{
"$schema": "https://json.schemastore.org/web-manifest-combined.json",
"name": "Bee's Gospel",
"short_name": "Bee's Gospel",
"start_url": "/",
"display": "standalone",
"background_color": "#fff",
"lang": "fr",
"icons": [{
"src": "{% static 'img/abeille-192.png' %}",
"sizes": "192x192",
"type": "image/png"
}, {
"src": "{% static 'img/abeille-512.png' %}",
"sizes": "512x512",
"type": "image/png"
}, {
"src": "{% static 'img/abeille-1024.png' %}",
"sizes": "1024x1024",
"type": "image/png"
},
{
"src": "{% static 'img/abeille.svg' %}",
"sizes": "any"
}]
}