summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Burkov <vasjaforutube@gmail.com>2017-05-28 01:50:35 +0100
committerTim Graham <timograham@gmail.com>2017-05-27 20:50:35 -0400
commit8c45b5b903e1ee4611577b98d43074b6f26089ef (patch)
tree51262a3b96bf1cd92dfc941ea5b2e1c206312c34
parentc3e638112d2a96c8d678524903f37b13c6692188 (diff)
Added comments to contrib.sitemaps.index() view.
-rw-r--r--django/contrib/sitemaps/views.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/django/contrib/sitemaps/views.py b/django/contrib/sitemaps/views.py
index 948c7bc5c4..ab6b9a6d24 100644
--- a/django/contrib/sitemaps/views.py
+++ b/django/contrib/sitemaps/views.py
@@ -27,14 +27,17 @@ def index(request, sitemaps,
req_protocol = request.scheme
req_site = get_current_site(request)
- sites = []
+ sites = [] # all sections' sitemap URLs
for section, site in sitemaps.items():
+ # For each section label, add links of all pages of its sitemap
+ # (usually generated by the `sitemap` view).
if callable(site):
site = site()
protocol = req_protocol if site.protocol is None else site.protocol
sitemap_url = reverse(sitemap_url_name, kwargs={'section': section})
absolute_url = '%s://%s%s' % (protocol, req_site.domain, sitemap_url)
sites.append(absolute_url)
+ # Add links to all pages of the sitemap.
for page in range(2, site.paginator.num_pages + 1):
sites.append('%s?p=%s' % (absolute_url, page))