mod: размещение фавиконок, манифесты и роутинг из корня public

This commit is contained in:
2026-10-10 18:43:53 +03:00
parent ff2314e42e
commit d826907ad5
11 changed files with 41 additions and 6 deletions
+10
View File
@@ -18,10 +18,20 @@ from django.contrib import admin
from django.urls import path, include, re_path
from django.conf import settings
from django.conf.urls.static import static
from django.views.static import serve
from frontend import views
urlpatterns = [
# Раздача статических файлов из корня каталога PUBLIC_DIR (favicon.ico, favicon.png, favicon.svg, robots.txt и др.)
# Роут с точкой в имени файла строго отделяет файлы от слагов хабов/статей.
re_path(
r'^(?P<path>[-a-zA-Z0-9_]+\.[a-zA-Z0-9]+)$',
serve,
{'document_root': settings.PUBLIC_DIR},
name='public_root_files',
),
# Админ-сайт с переименованными приложениями (переопределен в frontend/apps.py)
path(settings.ADMIN_URL, admin.site.urls),
+3 -3
View File
@@ -11,9 +11,9 @@
<meta name="meta-title" content="ОШИБКА 404 — LPON.RU" />
<link rel="canonical" href="{{ request.scheme }}://{{ request.get_host }}{{ request.path }}" />
{# Шутка #}<meta name="generator" content="Microsoft FrontPage 1.0" />
<link rel="icon" type="image/svg+xml" href="{% static 'svgs/favicon.svg' %}" />
<link rel="icon" type="image/png" href="{% static 'img/favicon.png' %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}" />{% if IS_DEBUG %}{% comment %}
<link rel="icon" type="image/svg+xml" href="{% static '/favicon.svg' %}" />
<link rel="icon" type="image/png" href="/favicon.png" />
<link rel="shortcut icon" type="image/x-icon" href="/favicon.ico" />{% if IS_DEBUG %}{% comment %}
Переключение dev/prod стилей Tailwind CSS происходит
АВТОМАТИЧЕСКИ через переменную IS_DEBUG (см. контексный-процессор
frontend/context_processors.py), DEV: tailwindcss из CDN, компилируется прямо в браузере. Удобно
+6 -3
View File
@@ -26,9 +26,12 @@
<meta name="twitter:image" content="{% block TWITTER_IMAGE %}{% static 'img/og-lpon-default.png' %}{% endblock %}" />
<meta name="theme-color" content="#F5F5F5" />
{# Шутка #}<meta name="generator" content="Microsoft FrontPage 1.0" />
<link rel="icon" type="image/svg+xml" href="{% static 'svgs/favicon.svg' %}" />
<link rel="icon" type="image/png" href="{% static 'img/favicon.png' %}" />
<link rel="shortcut icon" type="image/x-icon" href="{% static 'img/favicon.ico' %}" />{% if IS_DEBUG %}{% comment %}
<meta name="apple-mobile-web-app-title" content="LPON" />
<link rel="icon" type="image/png" href="/favicon.png" sizes="96x96" />
<link rel="icon" type="image/svg+xml" href="/favicon.svg" />
<link rel="shortcut icon" href="/favicon.ico" />
<link rel="apple-touch-icon" sizes="180x180" href="/apple-touch-icon.png" />
<link rel="manifest" href="/site.webmanifest" />{% if IS_DEBUG %}{% comment %}
Переключение dev/prod стилей Tailwind CSS происходит
АВТОМАТИЧЕСКИ через переменную IS_DEBUG (см. контексный-процессор
frontend/context_processors.py), DEV: tailwindcss из CDN, компилируется прямо в браузере. Удобно
Binary file not shown.

After

Width:  |  Height:  |  Size: 2.9 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.2 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.3 KiB

After

Width:  |  Height:  |  Size: 1.5 KiB

File diff suppressed because one or more lines are too long

After

Width:  |  Height:  |  Size: 5.7 KiB

+21
View File
@@ -0,0 +1,21 @@
{
"name": "LPON.ru",
"short_name": "LPON",
"icons": [
{
"src": "/web-app-manifest-192x192.png",
"sizes": "192x192",
"type": "image/png",
"purpose": "maskable"
},
{
"src": "/web-app-manifest-512x512.png",
"sizes": "512x512",
"type": "image/png",
"purpose": "maskable"
}
],
"theme_color": "#ffffff",
"background_color": "#ffffff",
"display": "standalone"
}
Binary file not shown.

After

Width:  |  Height:  |  Size: 3.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB