From c583a69362f86fcc8e1b35a45a06dd8377d6308f Mon Sep 17 00:00:00 2001 From: mjfernez Date: Thu, 14 Oct 2021 20:14:53 -0400 Subject: Adds RSS auto-generation for files in 'site' This commit adds rss_generator.py which contains the main logic for indexing the site directory and generating a feed on startup. It serves as a sort of ad-hoc database which is accessed when /feed.xml is requested. Also corrects various typos, README nonsense, and expands the config options for RSS. Instances of './templates/site' have been replaced with the general BASE_DIR variable in the siteconfig. --- server.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'server.py') diff --git a/server.py b/server.py index 545f4b6..c5522b9 100644 --- a/server.py +++ b/server.py @@ -6,6 +6,7 @@ from flask import Flask from siteconfig import siteconfig from flask_compress import Compress from flask_caching import Cache +from rss_generator import RSS_Item, get_rss_channel app = Flask(__name__) compress = Compress() @@ -41,11 +42,12 @@ def setup(): app.config.update( {'COMPRESS_MIMETYPES': siteconfig.COMPRESS_MIMETYPES} ) + app.config.update({'RSS_CHANNEL': get_rss_channel()}) # Setup needs to come first to be compatible with wsgi setup() +compress.init_app(app) +cache.init_app(app) if __name__ == "__main__": - compress.init_app(app) - cache.init_app(app) app.run() -- cgit v1.2.3