mirror of
https://github.com/venthur/blag.git
synced 2025-11-25 20:52:43 +00:00
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
|
ctx['archive'] = archive
|
||||||
template = env.get_template('archive.html')
|
template = env.get_template('archive.html')
|
||||||
result = template.render(ctx)
|
result = template.render(ctx)
|
||||||
with open('archive.html', 'w') as fh:
|
with open('build/archive.html', 'w') as fh:
|
||||||
fh.write(result)
|
fh.write(result)
|
||||||
|
|
||||||
## generate tags
|
## generate tags
|
||||||
|
|||||||
@@ -1,5 +1,13 @@
|
|||||||
<ul>
|
<h1>Archive</h1>
|
||||||
|
|
||||||
{% for entry in archive %}
|
{% 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 %}
|
{% 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>
|
<nav>
|
||||||
<ul>
|
<ul>
|
||||||
<li><a href="/">Blog</a></li>
|
<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="/tags.html">Tags</a></li>
|
||||||
<li><a href="https://venthur.de/pages/about-me.html">About Me</a></li>
|
<li><a href="https://venthur.de/pages/about-me.html">About Me</a></li>
|
||||||
</ul>
|
</ul>
|
||||||
|
|||||||
Reference in New Issue
Block a user