Opened 8 years ago

Closed 5 years ago

#10907 closed New feature (fixed)

Adding google news sitemap support to django.contrib.sitemaps

Reported by: Lakin Wecker Owned by: Lakin Wecker
Component: contrib.sitemaps Version: 1.0
Severity: Normal Keywords:
Cc: msimoens Triage Stage: Design decision needed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:


Google News Sitemaps are very similar to normal sitemaps in that they build off of the sitemaps protocol. They add a new namespace to the xml file, along with some added news-specific attributes to eatch url.

This patch adds support for generation of these news sitemaps to the django.contrib.sitemaps application.

There were no tests for this package - so I have not added any news tests. I have however, made an attempt to update the documentation for sitemaps.

Attachments (1)

news_sitemaps.diff (9.8 KB) - added by Lakin Wecker 8 years ago.
Fixed the bugs.

Download all attachments as: .zip

Change History (11)

comment:1 Changed 8 years ago by anonymous

Needs documentation: unset
Needs tests: unset
Patch needs improvement: unset

It looks like you left a bit of hard-coded data on line 14 of django/contrib/sitemaps/templates/news_sitemap.xml

{% if url.keywords %}<news:keywords>Business, Mergers, Acquisitions</news:keywords>{% endif %} 

comment:2 Changed 8 years ago by msimoens

Cc: msimoens added

comment:3 Changed 8 years ago by Lakin Wecker

Owner: changed from nobody to Lakin Wecker
Status: newassigned

There are a couple of small bugs that i discovered this morning - working through those now.

Changed 8 years ago by Lakin Wecker

Attachment: news_sitemaps.diff added

Fixed the bugs.

comment:4 Changed 8 years ago by Lakin Wecker

Ok, those bugs have been ferretted out.

comment:5 Changed 7 years ago by Alex Gaynor

Triage Stage: UnreviewedDesign decision needed

comment:6 Changed 7 years ago by ChrisL

Ticket patch not updated.

I'm implementing this patch and can see the <news:keywords> content is still in place. Should read:

{% if url.keywords %}<news:keywords>

{% for keyword in keywords %}{{ url.keyword }}{% if not forloop.last %}, {% endif %}{% endfor %}

</news:keywords>{% endif %}

can't get the news sitemap content to pass through to the template correctly, likely this was part of the bugs that were cleaned up?

Please post the up to date patch.

comment:7 Changed 7 years ago by Timothée Peignier <timothee.peignier@…>

There also a mobile sitemap format existing, see :

comment:8 Changed 6 years ago by Gabriel Hurley

Component: Contrib appscontrib.sitemaps

comment:9 Changed 6 years ago by Chris Beaven

Severity: Normal
Type: New feature

comment:10 Changed 5 years ago by Jannis Leidel

Resolution: fixed
Status: assignedclosed

In [16474]:

Fixed #10907, #14190 and #15829 -- Pass item to sitemaps template to allow further customization like Google News enabled sitemaps. Thanks, manfre and lakinwecker.

Note: See TracTickets for help on using tickets.
Back to Top