add rss feed to articles
This commit is contained in:
parent
edf453244d
commit
3e35d179f5
5 changed files with 44 additions and 2 deletions
|
|
@ -5,6 +5,7 @@ from hub.services.models import (
|
|||
CloudProvider,
|
||||
ConsultingPartner,
|
||||
ServiceOffering,
|
||||
Article,
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -13,7 +14,12 @@ class StaticSitemap(Sitemap):
|
|||
priority = 1.0
|
||||
|
||||
def items(self):
|
||||
return ["services:homepage", "services:contact"]
|
||||
return [
|
||||
"services:homepage",
|
||||
"services:contact",
|
||||
"services:article_list",
|
||||
"services:article_rss",
|
||||
]
|
||||
|
||||
def location(self, item):
|
||||
return reverse(item)
|
||||
|
|
@ -60,3 +66,14 @@ class ConsultingPartnerSitemap(Sitemap):
|
|||
|
||||
def lastmod(self, obj):
|
||||
return obj.updated_at
|
||||
|
||||
|
||||
class ArticleSitemap(Sitemap):
|
||||
changefreq = "weekly"
|
||||
priority = 0.8
|
||||
|
||||
def items(self):
|
||||
return Article.objects.filter(is_published=True)
|
||||
|
||||
def lastmod(self, obj):
|
||||
return obj.updated_at
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue