mod: размещение фавиконок, манифесты и роутинг из корня public
This commit is contained in:
@@ -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),
|
||||
|
||||
|
||||
@@ -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, компилируется прямо в браузере. Удобно
|
||||
|
||||
@@ -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, компилируется прямо в браузере. Удобно
|
||||
|
||||
Reference in New Issue
Block a user