This repository has been archived by the owner on Aug 26, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 681
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix bug 780740 - Creates sitemap.xml for MDN
- Loading branch information
1 parent
02237bb
commit db8ed07
Showing
3 changed files
with
27 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from django.contrib.sitemaps import Sitemap | ||
from wiki.models import (Document, Revision) | ||
|
||
class DocumentSitemap(Sitemap): | ||
changefreq = 'weekly' | ||
priority = 0.5 | ||
|
||
def items(self): | ||
docs = Document.objects.filter(is_template=False) | ||
return docs | ||
|
||
def lastmod(self, doc): | ||
return doc.current_revision.created | ||
|
||
def location(self, doc): | ||
return doc.get_absolute_url() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters