For the webpages that list
Post objects according to date, I want to do something a little different. I want to list pages for both the year and the month archives, and I want these pages to be sorted according to date, so that the month archives appear before the year archives (for the same year). These requirements seem a little silly, but they force us to customize the
Sitemap a little more than before.
To start, we can get all of the dates for the
Post objects, first according to year, and then according to month, as shown in Example 28.35.
49 class PostArchiveSitemap(Sitemap): 50 51 def items(self): 52 year_dates ...