From 8f4b56863ec87113e879d0b358319470cff81a97 Mon Sep 17 00:00:00 2001
From: David Luevano Alvarado <david@luevano.xyz>
Date: Tue, 25 May 2021 02:35:09 -0600
Subject: add tags as categories

---
 src/pyssg/rss.py | 7 +++++++
 1 file changed, 7 insertions(+)

(limited to 'src')

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'
-- 
cgit v1.2.3-70-g09d2