From e9980b1a760c4afd617849663cda19fc69b40f65 Mon Sep 17 00:00:00 2001 From: David Luevano Alvarado Date: Sun, 23 May 2021 16:54:34 -0600 Subject: add rss support --- src/pyssg/pyssg.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/pyssg/pyssg.py') diff --git a/src/pyssg/pyssg.py b/src/pyssg/pyssg.py index 40c602b..a2f5102 100644 --- a/src/pyssg/pyssg.py +++ b/src/pyssg/pyssg.py @@ -6,6 +6,8 @@ from .configuration import Configuration from .database import Database from .template import Template from .builder import HTMLBuilder +from .page import Page +from .rss import RSSBuilder def get_options() -> Namespace: @@ -35,6 +37,11 @@ def get_options() -> Namespace: default='', type=str, help='''base url without trailing slash''') + parser.add_argument('-t', '--title', + default='Blog', + type=str, + help='''general title for the website; defaults to + 'Blog' ''') parser.add_argument('--date-format', default='%a, %b %d, %Y @ %H:%M %Z', type=str, @@ -102,5 +109,10 @@ def main() -> None: builder: HTMLBuilder = HTMLBuilder(config, template, db) builder.build() + # get all parsed pages for rss construction + all_pages: list[Page] = builder.get_pages() + rss_builder: RSSBuilder = RSSBuilder(template.rss, all_pages) + rss_builder.build() + db.write() return -- cgit v1.2.3-54-g00ecf