Opened 15 years ago

Closed 13 years ago

#12347 closed New feature (fixed)

Adds support to urllist.txt in django.contrib.sitemaps

Reported by: afurlan Owned by: Jannis Leidel
Component: contrib.sitemaps Version: 1.1
Severity: Normal Keywords: contrib, sitemaps, urllist
Cc: Triage Stage: Design decision needed
Has patch: yes Needs documentation: yes
Needs tests: yes Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

The Yahoo! Search Engine/Crawler supports some different types of sitemaps. Because of that, I use to always have two types of sitemaps available in my sites: sitemap.xml and urllist.txt. While the first one (sitemap.xml) is supported by Django, the last one (urllist.txt) isn't, so I'm adding a patch that adds support to it in the django.contrib.sitemaps application.

My patch takes advantages of the current Sitemap framework and uses the same configuration of django.contrib.sitemaps.views.sitemap to create the urllist.txt file. Once you have your sitemap.xml configured:

    (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),

you can add support to urllist.txt by just adding the following rule:

    (r'^sitemap.xml$', 'django.contrib.sitemaps.views.sitemap', {'sitemaps': sitemaps}),
    (r'^urllist.txt$', 'django.contrib.sitemaps.views.urllist', {'sitemaps': sitemaps}),

This patch is currently running on my blog: sitemap.xml and urllist.txt.

Attachments (1)

sitemaps-urllist.patch (1.2 KB ) - added by afurlan 15 years ago.
django.contrib.sitemaps.views.urllist

Download all attachments as: .zip

Change History (8)

by afurlan, 15 years ago

Attachment: sitemaps-urllist.patch added

django.contrib.sitemaps.views.urllist

comment:1 by afurlan, 15 years ago

Owner: changed from nobody to afurlan
Status: newassigned

comment:2 by afurlan, 15 years ago

Owner: afurlan removed
Status: assignednew

comment:3 by Jannis Leidel, 15 years ago

Needs documentation: set
Needs tests: set
Triage Stage: UnreviewedDesign decision needed

comment:4 by Gabriel Hurley, 14 years ago

Component: Contrib appscontrib.sitemaps

comment:5 by Matt McClanahan, 14 years ago

Severity: Normal
Type: New feature

comment:6 by Jannis Leidel, 13 years ago

Easy pickings: unset
Summary: [PATCH] Adds support to urllist.txt in django.contrib.sitemapsAdds support to urllist.txt in django.contrib.sitemaps
UI/UX: unset

comment:7 by Jannis Leidel, 13 years ago

Owner: set to Jannis Leidel
Resolution: fixed
Status: newclosed

In [16475]:

Fixed #12347 -- Added a mimetype option to sitemaps views to further customize the output of the view, e.g. to support Yahoo's plain text urllist format. Thanks, afurlan.

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