Opened 5 years ago

Closed 4 years ago

#12347 closed New feature (fixed)

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

Reported by: afurlan Owned by: jezdez
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 5 years ago.
django.contrib.sitemaps.views.urllist

Download all attachments as: .zip

Change History (8)

Changed 5 years ago by afurlan

django.contrib.sitemaps.views.urllist

comment:1 Changed 5 years ago by afurlan

  • Needs documentation unset
  • Needs tests unset
  • Owner changed from nobody to afurlan
  • Patch needs improvement unset
  • Status changed from new to assigned

comment:2 Changed 5 years ago by afurlan

  • Owner afurlan deleted
  • Status changed from assigned to new

comment:3 Changed 5 years ago by jezdez

  • Needs documentation set
  • Needs tests set
  • Triage Stage changed from Unreviewed to Design decision needed

comment:4 Changed 4 years ago by gabrielhurley

  • Component changed from Contrib apps to contrib.sitemaps

comment:5 Changed 4 years ago by mattmcc

  • Severity set to Normal
  • Type set to New feature

comment:6 Changed 4 years ago by jezdez

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

comment:7 Changed 4 years ago by jezdez

  • Owner set to jezdez
  • Resolution set to fixed
  • Status changed from new to closed

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