summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavid Luevano Alvarado <david@luevano.xyz>2021-05-23 16:59:47 -0600
committerDavid Luevano Alvarado <david@luevano.xyz>2021-05-23 16:59:47 -0600
commit595ec5770df7b841217916017a352ee8a04a8a64 (patch)
tree4975986dcea96c46d4e24d58eb879bec47acf7b1
parent16941098453252415c76abc4468ac4e5459124b2 (diff)
... literally 3 commits to fix a missing obj
-rw-r--r--ChangeLog1
-rw-r--r--src/pyssg/rss.py8
2 files changed, 5 insertions, 4 deletions
diff --git a/ChangeLog b/ChangeLog
index e1ae71a..39ddc16 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,7 @@
CHANGES
=======
+* ACTUALLY add missing config obj lol
* fix missing config obj
* add rss support
diff --git a/src/pyssg/rss.py b/src/pyssg/rss.py
index ab2dff1..48710f9 100644
--- a/src/pyssg/rss.py
+++ b/src/pyssg/rss.py
@@ -21,8 +21,8 @@ class RSSBuilder:
def build(self):
# initial base replacements
- self.rss = self.rss.replace('$$TITLE', config.title)
- self.rss = self.rss.replace('$$LINK', config.base_url)
+ self.rss = self.rss.replace('$$TITLE', self.config.title)
+ self.rss = self.rss.replace('$$LINK', self.config.base_url)
self.rss = self.rss.replace('$$PYSSGVERSION', VERSION)
items_formatted: str = __get_items_formatted()
self.rss = self.rss.replace('$$ITEMS', items_formatted)
@@ -30,7 +30,7 @@ class RSSBuilder:
current_date: str = datetime.now(tz=timezone.utc).strftime(DFORMAT)
self.rss = self.rss.replace('$$CURRENTDATE', current_date)
- with open(os.path.join(config.dst, 'rss.xml'), 'w') as f:
+ with open(os.path.join(self.config.dst, 'rss.xml'), 'w') as f:
f.write(self.rss)
@@ -38,7 +38,7 @@ class RSSBuilder:
# i_f=items formatted for short
i_f: str = ''
for p in pages:
- url: str = f'{config.base_url}/{p.name.replace(".md", ".html")}'
+ url: str = f'{self.config.base_url}/{p.name.replace(".md", ".html")}'
date: str = p.c_datetime.strftime(DFORMAT)
i_f = f'{i_f} <item>\n'