From bbeed5c9f0badc348d3d296e1ad5f28b18343948 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joakim=20Hells=C3=A9n?= Date: Wed, 11 Feb 2026 22:15:14 +0100 Subject: [PATCH] Improve SEO --- config/urls.py | 6 +- pyproject.toml | 2 +- templates/base.html | 3 +- templates/includes/meta_tags.html | 70 +++ twitch/tests/test_views.py | 488 ++++++++++++++++++ twitch/views.py | 807 ++++++++++++++++++++++++++++-- 6 files changed, 1331 insertions(+), 45 deletions(-) create mode 100644 templates/includes/meta_tags.html diff --git a/config/urls.py b/config/urls.py index ae56148..49724ee 100644 --- a/config/urls.py +++ b/config/urls.py @@ -7,11 +7,15 @@ from django.conf.urls.static import static from django.urls import include from django.urls import path +from twitch import views as twitch_views + if TYPE_CHECKING: from django.urls.resolvers import URLPattern from django.urls.resolvers import URLResolver -urlpatterns: [URLPattern | URLResolver] = [ # type: ignore[assignment] +urlpatterns: list[URLPattern | URLResolver] = [ + path("sitemap.xml", twitch_views.sitemap_view, name="sitemap"), + path("robots.txt", twitch_views.robots_txt_view, name="robots"), path(route="", view=include("twitch.urls", namespace="twitch")), ] diff --git a/pyproject.toml b/pyproject.toml index 43d48f3..4242132 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -103,4 +103,4 @@ line-length = 120 [tool.djlint] profile = "django" -ignore = "H021" +ignore = "H021,H030" diff --git a/templates/base.html b/templates/base.html index bbae34e..21a64d3 100644 --- a/templates/base.html +++ b/templates/base.html @@ -16,14 +16,13 @@ - {% block title %} ttvdrops {% endblock title %} + {% include "includes/meta_tags.html" %}