From 68953481080dbc63aaa9e4cab47d10ef779c357a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Chlo=C3=A9?= <104012698+chloend@users.noreply.github.com> Date: Sun, 17 Nov 2024 17:09:04 +0100 Subject: [PATCH] feat: Ajout d'un sitemap (#1450) --- config/settings/base.py | 1 + config/urls.py | 3 + lemarche/templates/layouts/_footer.html | 3 + lemarche/templates/pages/plan_du_site.html | 19 ++++++ lemarche/www/pages/tests.py | 76 ++++++++++++++++++++++ lemarche/www/pages/urls.py | 2 + lemarche/www/pages/views.py | 20 ++++++ 7 files changed, 124 insertions(+) create mode 100644 lemarche/templates/pages/plan_du_site.html diff --git a/config/settings/base.py b/config/settings/base.py index 0df31deb2..b15e7bace 100644 --- a/config/settings/base.py +++ b/config/settings/base.py @@ -98,6 +98,7 @@ "django.contrib.sessions", "django.contrib.messages", "django.contrib.staticfiles", + "django.contrib.sitemaps", "django.contrib.sites", "django.contrib.flatpages", "django.contrib.gis", diff --git a/config/urls.py b/config/urls.py index 0706b17fd..5476ca536 100644 --- a/config/urls.py +++ b/config/urls.py @@ -3,6 +3,7 @@ from django.urls import include, path from wagtail import urls as wagtail_urls from wagtail.admin import urls as wagtailadmin_urls +from wagtail.contrib.sitemaps.views import sitemap from wagtail.documents import urls as wagtaildocs_urls from wagtail_transfer import urls as wagtailtransfer_urls @@ -20,6 +21,8 @@ path("profil/reseaux/", include("lemarche.www.dashboard_networks.urls")), path("profil/listes-dachats/", include("lemarche.www.dashboard_favorites.urls")), path("select2/", include("django_select2.urls")), + # sitemap + path("sitemap.xml", sitemap, name="sitemap"), # appears above the default Wagtail page serving route # admin blog path("cms/", include(wagtailadmin_urls)), path("blog/", include("blog.urls")), diff --git a/lemarche/templates/layouts/_footer.html b/lemarche/templates/layouts/_footer.html index 1938ae8db..8688b51f5 100644 --- a/lemarche/templates/layouts/_footer.html +++ b/lemarche/templates/layouts/_footer.html @@ -67,6 +67,9 @@