aboutsummaryrefslogtreecommitdiff
path: root/content/templates/base.html
blob: 090cbea807a9d0c4fca60a56f0d6684e1632f59e (plain) (blame)
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
{# Page layout for org-ssg, mirroring theme/templates/base.html.

   Styling comes from theme/static/styles.css, published by `[build] assets` in
   org-ssg.toml — the same directory weblorg serves at /, read in place rather than
   copied. weblorg links the minified styles.min.css instead; that file is gitignored
   build output and the rules are the same, so this links the tracked one.

   Available here: page (.title .url .source .date .date_iso .tags .excerpt .toc
   .keywords), site, nav, root, stylesheet. See the org-ssg guide on Templates. #}
{#- The table of contents, in the shape Emacs exports it. `page.toc` is a tree of
    {title, anchor, level, number, children}, and it is empty when the page has no
    headings or says `#+OPTIONS: toc:nil` — so pages that opt out render nothing here.
    The number is printed because [html] section_numbers is on; drop it if you turn
    numbering off, or the contents will number what the headings do not. #}
{%- macro toc_list(entries) -%}
<ul>
{%- for e in entries %}
<li><a href="#{{ e.anchor }}">{{ e.number }} {{ e.title }}</a>
{%- if e.children %}{{ toc_list(e.children) }}{% endif %}</li>
{%- endfor %}
</ul>
{%- endmacro %}
{%- macro toc(entries) -%}
{%- if entries %}
<div id="table-of-contents" role="doc-toc">
<h2>Table of Contents</h2>
<div id="text-table-of-contents" role="doc-toc">
{{- toc_list(entries) }}
</div>
</div>
{%- endif %}
{%- endmacro %}
<!DOCTYPE html>
<html lang="{{ site.language }}">
<head>
<meta charset="utf-8">
<title>{% block subtitle %}{{ page.title }} - {% endblock %}{{ site.title }}</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="author" content="Christian Cleberg &lt;[email protected]&gt;">
<meta name="description" content="{% if page.excerpt %}{{ page.excerpt | truncate(150) }}{% else %}{{ site.description }}{% endif %}">
<meta property="og:title" content="{{ page.title }}">
<meta property="og:url" content="{{ page.url | absolute | replace("index.html", "") }}">
<meta property="og:description" content="{% if page.excerpt %}{{ page.excerpt | truncate(150) }}{% else %}{{ site.description }}{% endif %}">
<link rel="canonical" href="{{ page.url | absolute | replace("index.html", "") }}">
<link rel="alternate" type="application/rss+xml" title="{{ site.title }}" href="{{ root }}feed.xml">
<link rel="stylesheet" href="{{ root }}styles.css" type="text/css">
<link rel="icon" href="data:,">
{#- rel="me" identity links. weblorg's base.html writes the last one as <a>, which a
    browser hoists out of <head>; <link> is the spelling that stays where it is put. #}
<link href="https://github.com/ccleberg" rel="me">
<link href="https://gitlab.com/ccleberg" rel="me">
<link href="mailto:[email protected]" rel="me">
<link href="https://c.im/@cmc" rel="me">
{%- if stylesheet %}
<link rel="stylesheet" href="{{ stylesheet }}">
{%- endif %}
</head>
<body>
<a href="#main-content" class="skip-link">Skip to content</a>

<nav aria-label="Site Navigation">
<ul>
<li><a href="{{ root }}index.html">Home</a></li>
{%- for item in nav %}
<li><a href="{{ item.url }}">{{ item.title }}</a></li>
{%- endfor %}
</ul>
</nav>

<main id="main-content">
{% block main %}
<article>
<h1>{{ page.title }}</h1>
{%- if page.date_iso %}
<p><time datetime="{{ page.date_iso }}">{{ page.date_iso }}</time>{% if page.excerpt %} &middot; {{ page.excerpt }}{% endif %}</p>
{%- endif %}
{%- if page.tags %}
<p>{% for tag in page.tags %}<a href="{{ root }}tags/{{ tag }}.html">#{{ tag }}</a> {% endfor %}</p>
{%- endif %}
{#- Blog posts add a reply footer inside this block; see post.html, which the
    [[pages]] rule in org-ssg.toml selects for everything under blog/. #}
<div>
{{- toc(page.toc) }}
{% block content %}{{ body | safe }}{% endblock %}</div>
</article>
{% endblock %}
</main>

<footer>
<a href="https://git.krz.sh/cmc/cleberg.net.git/">Source</a> &middot;
<a href="{{ root }}feed.xml">RSS</a> &middot;
<a href="http://paske4urhs6nttrtlkuwa5cowum3fjkc6yv6kl4ncx3mjxcd77764nqd.onion/">Onion</a> &middot;
<a href="{{ root }}tips/index.html">Tips</a> &middot;
<a href="https://iheartrss.com/">I &hearts; RSS</a>
<p>[ <a href="https://krz.sh">krz</a> &middot; <a href="https://audit-labs.dev">audit labs</a> ]</p>
</footer>
</body>
</html>