Feature: Add setting to append ref parameter to links in feeds (#3249)

This commit is contained in:
GiovanH 2024-04-19 13:54:27 -05:00 committed by GitHub
commit 0b5934a1fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 9 additions and 0 deletions

View file

@ -52,6 +52,7 @@ DEFAULT_CONFIG = {
"TRANSLATION_FEED_ATOM": "feeds/all-{lang}.atom.xml",
"FEED_MAX_ITEMS": 100,
"RSS_FEED_SUMMARY_ONLY": True,
"FEED_APPEND_REF": False,
"SITEURL": "",
"SITENAME": "A Pelican Blog",
"DISPLAY_PAGES_ON_MENU": True,

View file

@ -53,6 +53,9 @@ class Writer:
title = Markup(item.title).striptags()
link = self.urljoiner(self.site_url, item.url)
if self.settings["FEED_APPEND_REF"]:
link = link + "?ref=feed"
if isinstance(feed, Rss201rev2Feed):
# RSS feeds use a single tag called 'description' for both the full
# content and the summary