forked from github.com/blag
archive improvements
This commit is contained in:
2
sg/sg.py
2
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
|
||||
|
||||
@@ -1,5 +1,13 @@
|
||||
<ul>
|
||||
<h1>Archive</h1>
|
||||
|
||||
{% for entry in archive %}
|
||||
<li><a href="{{entry.dst}}">{{entry.title}}</a></li>
|
||||
|
||||
{% if entry.title %}
|
||||
<h1><a href="{{entry.dst}}">{{entry.title}}</a></h1>
|
||||
{% endif %}
|
||||
|
||||
{% if entry.date %}
|
||||
<p>Written on {{ entry.date.date() }}.</p>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
</ul>
|
||||
|
||||
26
templates/archive.html
Normal file
26
templates/archive.html
Normal file
@@ -0,0 +1,26 @@
|
||||
{% extends "base.html" %}
|
||||
|
||||
{% block title %}{{ title }}{% endblock %}
|
||||
|
||||
{% block head %}
|
||||
{{ super() }}
|
||||
{% endblock %}
|
||||
|
||||
|
||||
{% block content %}
|
||||
|
||||
<h1>Archive</h1>
|
||||
|
||||
{% for entry in archive %}
|
||||
|
||||
{% if entry.title %}
|
||||
<h1><a href="{{entry.dst}}">{{entry.title}}</a></h1>
|
||||
{% endif %}
|
||||
|
||||
{% if entry.date %}
|
||||
<p>Written on {{ entry.date.date() }}.</p>
|
||||
{% endif %}
|
||||
|
||||
{% endfor %}
|
||||
|
||||
{% endblock %}
|
||||
@@ -18,7 +18,7 @@
|
||||
<nav>
|
||||
<ul>
|
||||
<li><a href="/">Blog</a></li>
|
||||
<li><a href="/archives.html">Archive</a></li>
|
||||
<li><a href="/archive.html">Archive</a></li>
|
||||
<li><a href="/tags.html">Tags</a></li>
|
||||
<li><a href="https://venthur.de/pages/about-me.html">About Me</a></li>
|
||||
</ul>
|
||||
|
||||
Reference in New Issue
Block a user