aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--app.py8
-rw-r--r--templates/list.html1
2 files changed, 5 insertions, 4 deletions
diff --git a/app.py b/app.py
index 9c558b8..abe2ccf 100644
--- a/app.py
+++ b/app.py
@@ -44,10 +44,10 @@ def index():
files.sort(key=os.path.getctime)
for file in files[::-1]:
try:
- articles += "\n<li><a href=\"" + file.replace(".md", "") + "\">" + \
- config[file.replace(".md", "").replace("articles/", "")]['Title'] + "</a>" \
- + " - " + config[file.replace(".md", "").replace("articles/", "")]['Date'] + \
- "</li>"
+ articles += render_template('list.html', file = file.replace(".md", ""),
+ date = config[file.replace(".md", "").replace("articles/", "")]['Date'],
+ article = config[ \
+ file.replace(".md", "").replace("articles/", "")]['Title'])
except KeyError:
return "<code>No config.ini entry! " + \
"Please create a config.ini entry for the %s article!</code>" % file
diff --git a/templates/list.html b/templates/list.html
new file mode 100644
index 0000000..6fae1cd
--- /dev/null
+++ b/templates/list.html
@@ -0,0 +1 @@
+<li><a href="{{ file }}">{{ article }}</a> - {{ date }}</li>