From b693bcdabcdb7b5b31efa9dd684ed93cfc3e3a74 Mon Sep 17 00:00:00 2001 From: tiyn Date: Mon, 1 Aug 2022 00:54:00 +0200 Subject: [PATCH] src: cleanup --- src/app.py | 14 +++++++++----- src/content.py | 7 ++++--- src/database.py | 14 +++++--------- src/static/css/style.css | 20 +++++++++++++++----- src/templates/archive.html | 1 + src/templates/error.html | 1 + src/templates/index.html | 1 + src/templates/standalone.html | 1 + src/templates/template.html | 10 ++++++++-- 9 files changed, 45 insertions(+), 24 deletions(-) diff --git a/src/app.py b/src/app.py index 24901fc..89838c9 100644 --- a/src/app.py +++ b/src/app.py @@ -32,34 +32,38 @@ REGISTER = config.REGISTER @app.errorhandler(404) def page_not_found(e): - return render_template("error.html", title=TITLE, errorcode="404", style=STYLE), 404 + return render_template("error.html", title=TITLE, errorcode="404", + style=STYLE), 404 @app.route("/") @app.route("/index.html") def index(): content = con_gen.gen_index_string() - return render_template("index.html", title=TITLE, content_string=content, style=STYLE) + return render_template("index.html", title=TITLE, content_string=content, + style=STYLE) @app.route("/archive") @app.route("/archive.html") def archive(): content = con_gen.gen_arch_string() - return render_template("archive.html", title=TITLE, content_string=content, style=STYLE) + return render_template("archive.html", title=TITLE, content_string=content, + style=STYLE) @app.route("/entry/") def entry(ident): content = con_gen.gen_stand_string(ident) if content != "": - return render_template("standalone.html", title=TITLE, content_string=content, style=STYLE) + return render_template("standalone.html", title=TITLE, + content_string=content, style=STYLE) abort(404) @app.route("/feed") -@app.route("/rss") @app.route("/feed.xml") +@app.route("/rss") @app.route("/rss.xml") def feed(): content = con_gen.get_rss_string() diff --git a/src/content.py b/src/content.py index 6adef1a..b4949d1 100644 --- a/src/content.py +++ b/src/content.py @@ -35,6 +35,7 @@ def gen_arch_string(): if entries is None: return "" entries.sort(key=lambda y: y[2]) + entries.reverse() for entry in entries: ident = entry[0] title = entry[1] @@ -47,9 +48,9 @@ def gen_arch_string(): content_string += "