-
-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #77 from jtweeder/sitemaps
sitemap changes for blog posts
- Loading branch information
Showing
2 changed files
with
17 additions
and
3 deletions.
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 |
---|---|---|
@@ -1,13 +1,27 @@ | ||
from django.contrib import sitemaps | ||
from django.urls import reverse | ||
from stewpot.models import meal_posting | ||
|
||
|
||
class StaticViewSitemap(sitemaps.Sitemap): | ||
priority = 0.5 | ||
changefreq = 'daily' | ||
|
||
def items(self): | ||
return ['index', 'get-recipe', 'about', 'howto', 'change_log', 'ccc'] | ||
return ['index', 'get-recipe', 'about', 'howto', 'change_log', 'ccc', 'home-postings'] | ||
|
||
def location(self, item): | ||
return reverse(item) | ||
|
||
class BlogSitemap(sitemaps.Sitemap): | ||
changefreq = "weekly" | ||
priority = 0.5 | ||
|
||
def items(self): | ||
return meal_posting.objects.all() | ||
|
||
def lastmod(self, obj): | ||
return obj.created_on | ||
|
||
def location(self, obj): | ||
return f'/share/post/{obj.id}' |
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