diff --git a/sg/sg.py b/sg/sg.py index eef802e..e71db3e 100644 --- a/sg/sg.py +++ b/sg/sg.py @@ -177,7 +177,7 @@ def convert_to_html(convertibles): ctx['archive'] = archive template = env.get_template('archive.html') result = template.render(ctx) - with open('archive.html', 'w') as fh: + with open('build/archive.html', 'w') as fh: fh.write(result) ## generate tags diff --git a/sg/templates/archive.html b/sg/templates/archive.html index fb5971f..06c177b 100644 --- a/sg/templates/archive.html +++ b/sg/templates/archive.html @@ -1,5 +1,13 @@ - diff --git a/templates/archive.html b/templates/archive.html new file mode 100644 index 0000000..df92d5c --- /dev/null +++ b/templates/archive.html @@ -0,0 +1,26 @@ +{% extends "base.html" %} + +{% block title %}{{ title }}{% endblock %} + +{% block head %} + {{ super() }} +{% endblock %} + + +{% block content %} + +

Archive

+ +{% for entry in archive %} + + {% if entry.title %} +

{{entry.title}}

+ {% endif %} + + {% if entry.date %} +

Written on {{ entry.date.date() }}.

+ {% endif %} + +{% endfor %} + +{% endblock %} diff --git a/templates/base.html b/templates/base.html index 4bacd1a..17d0dcc 100644 --- a/templates/base.html +++ b/templates/base.html @@ -18,7 +18,7 @@