Skip to content

Commit

Permalink
Add feature to add rel param to rss feedss if requested
Browse files Browse the repository at this point in the history
  • Loading branch information
GiovanH committed Nov 22, 2023
1 parent d9b2bc3 commit c497034
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
1 change: 1 addition & 0 deletions pelican/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ def load_source(name, path):
"TRANSLATION_FEED_ATOM": "feeds/all-{lang}.atom.xml",
"FEED_MAX_ITEMS": 100,
"RSS_FEED_SUMMARY_ONLY": True,
"RSS_REL": False,
"SITEURL": "",
"SITENAME": "A Pelican Blog",
"DISPLAY_PAGES_ON_MENU": True,
Expand Down
3 changes: 3 additions & 0 deletions pelican/writers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,9 @@ def _add_item_to_the_feed(self, feed, item):
title = Markup(item.title).striptags()
link = self.urljoiner(self.site_url, item.url)

if self.settings["RSS_REL"]:
link = link + "?rel=rss"

if isinstance(feed, Rss201rev2Feed):
# RSS feeds use a single tag called 'description' for both the full
# content and the summary
Expand Down

0 comments on commit c497034

Please sign in to comment.