blob: 3922659e4b3303abac77ccdf7d5f9ac3a9dca019 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
|
{% macro toc(page) %}
<nav class="toc">
<ul>
{% for h in page.toc %}
<li><a href="{{ h.permalink }}">{{ h.title }}</a></li>
{% if h.children %}
<ul>
{% for c in h.children %}
<li><a href="{{ c.permalink }}">{{ c.title }}</a></li>
{% endfor %}
</ul>
{% endif %}
{% endfor %}
</ul>
</nav>
{% endmacro %}
{% macro linklog(page) %}
{% set lh_data = load_data(path="linklog.json") %}
<ul class="archive-list">
{% for lh_post in lh_data.posts %}
<li class="archive-entry">
<a href="{{ lh_post.href }}">{{ lh_post.description }}</a>
<small>({{ lh_post.time | date(format='%Y-%m-%d') }})</small>
</li>
{% endfor %}
</ul>
{% endmacro %}
{% macro page_h1(page) %}
<h1>
{{ page.title }}<br />
{% if page.date %}
<small>({{ page.date }})</small>
{% endif %}
{% if page.extra.kind %}
<small>[{{ page.extra.kind }}]</small>
{% endif %}
</h1>
{% endmacro %}
{% macro page_content(page) %}
{{ self::page_h1(page=page) }}
{{ page.content | replace(from="<!-- toc -->", to=macros::toc(page=page)) | safe }}
{% endmacro %}
|