diff --git a/src/app.py b/src/app.py index 0b236e7..8d947bf 100644 --- a/src/app.py +++ b/src/app.py @@ -1,4 +1,4 @@ -from flask import Flask, flash, make_response, render_template, request, redirect, abort +from flask import Flask, make_response, render_template, abort import content as con_gen import config @@ -25,7 +25,7 @@ def index(): @app.route("/archive") @app.route("/archive.html") -def blog_archive(): +def archive(): content = con_gen.gen_arch_string() return render_template("archive.html", title=TITLE, content_string=content, style=STYLE) diff --git a/src/content.py b/src/content.py index ffd16c9..3024b4e 100644 --- a/src/content.py +++ b/src/content.py @@ -6,7 +6,7 @@ import pathlib import config -ENTRY_DIR = 'templates/entry' +ENTRY_DIR = "templates/entry" def gen_arch_string(): """ @@ -20,34 +20,34 @@ def gen_arch_string(): name_list = os.listdir(path_ex) full_list = [os.path.join(path_ex, i) for i in name_list] contents = sorted(full_list, key=os.path.getctime) - content_string = '' - last_month = '' + content_string = "" + last_month = "" for file in reversed(contents): curr_date = datetime.fromtimestamp( - os.path.getctime(file)).strftime('%Y-%m-%d') + os.path.getctime(file)).strftime("%Y-%m-%d") curr_month = datetime.fromtimestamp( - os.path.getctime(file)).strftime('%b %Y') + os.path.getctime(file)).strftime("%b %Y") if curr_month != last_month: - if last_month != '': - content_string += '\n' - content_string += '