summaryrefslogtreecommitdiff
path: root/docs
diff options
context:
space:
mode:
authorArkadiusz Adamski <arkadiusz.adamski@gmail.com>2021-10-21 16:09:29 +0200
committerMariusz Felisiak <felisiak.mariusz@gmail.com>2021-10-21 20:27:53 +0200
commitac815f6ea83a66122ee434f773f8c923f4cd3125 (patch)
tree34c594557c0c04d63aa61e455bd8f338b4fa5fc5 /docs
parenta2e1cdc8cacff6726705389ef221e8cbdd79f9dd (diff)
[4.0.x] Fixed #33210 -- Clarified docs for sitemaps ping_google() helper.
Backport of 1405dc78872f9d18180feebb4f2c57dbe1259acb from main
Diffstat (limited to 'docs')
-rw-r--r--docs/ref/contrib/sitemaps.txt15
1 files changed, 10 insertions, 5 deletions
diff --git a/docs/ref/contrib/sitemaps.txt b/docs/ref/contrib/sitemaps.txt
index 709a3679a4..e332e123bc 100644
--- a/docs/ref/contrib/sitemaps.txt
+++ b/docs/ref/contrib/sitemaps.txt
@@ -409,7 +409,8 @@ Here's what the relevant URLconf lines would look like for the example above::
from django.contrib.sitemaps import views
urlpatterns = [
- path('sitemap.xml', views.index, {'sitemaps': sitemaps}),
+ path('sitemap.xml', views.index, {'sitemaps': sitemaps},
+ name='django.contrib.sitemaps.views.index'),
path('sitemap-<section>.xml', views.sitemap, {'sitemaps': sitemaps},
name='django.contrib.sitemaps.views.sitemap'),
]
@@ -453,7 +454,7 @@ parameter to the ``sitemap`` and ``index`` views via the URLconf::
path('custom-sitemap.xml', views.index, {
'sitemaps': sitemaps,
'template_name': 'custom_sitemap.html'
- }),
+ }, name='django.contrib.sitemaps.views.index'),
path('custom-sitemap-<section>.xml', views.sitemap, {
'sitemaps': sitemaps,
'template_name': 'custom_sitemap.html'
@@ -544,9 +545,13 @@ that: :func:`django.contrib.sitemaps.ping_google()`.
``ping_google`` takes these optional arguments:
* ``sitemap_url`` - The absolute path to your site's sitemap (e.g.,
- :file:`'/sitemap.xml'`). If this argument isn't provided, ``ping_google``
- will attempt to figure out your sitemap by performing a reverse lookup in
- your URLconf.
+ :file:`'/sitemap.xml'`).
+
+ If this argument isn't provided, ``ping_google`` will perform a reverse
+ lookup in your URLconf, for URLs named
+ ``'django.contrib.sitemaps.views.index'`` and then
+ ``'django.contrib.sitemaps.views.sitemap'`` (without further arguments) to
+ automatically determine the sitemap URL.
* ``ping_url`` - Defaults to Google's Ping Tool:
https://www.google.com/webmasters/tools/ping.