summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2021-05-25 02:35:09 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2021-05-25 02:35:09 -0600
commit8f4b56863ec87113e879d0b358319470cff81a97 (patch)
tree6452417555346a5a26f9431b3db1ad0ada425fee /src
parente667ddc7ee47d0897ffc5b569aadeafaa829d6a4 (diff)
add tags as categories
Diffstat (limited to 'src')
-rw-r--r--src/pyssg/rss.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/pyssg/rss.py b/src/pyssg/rss.py
index 4cd4695..742b6b2 100644
--- a/src/pyssg/rss.py
+++ b/src/pyssg/rss.py
@@ -7,6 +7,8 @@ from .configuration import Configuration
VERSION = importlib.metadata.version('pyssg')
+# This is static right here since an rss feed
+# requires very specific date format
DFORMAT = '%a, %d %b %Y %H:%M:%S GMT'
@@ -46,6 +48,11 @@ class RSSBuilder:
i_f = f'{i_f} <link>{url}</link>\n'
i_f = f'{i_f} <guid isPermaLink="true">{url}</guid>\n'
i_f = f'{i_f} <pubDate>{date}</pubDate>\n'
+ # TODO: maybe make this optional?
+ # add the tags as categories
+ if p.tags is not None:
+ for t in p.tags:
+ i_f = f'{i_f} <category>{t.capitalize()}</category>\n'
i_f = f'{i_f} <description>{p.summary}</description>\n'
i_f = f'{i_f} <content:encoded><![CDATA[{p.html}]]></content:encoded>\n'
i_f = f'{i_f} </item>\n'