diff options
Diffstat (limited to 'content/templates')
| -rw-r--r-- | content/templates/base.html | 52 | ||||
| -rw-r--r-- | content/templates/home.html | 44 | ||||
| -rw-r--r-- | content/templates/list.html | 13 | ||||
| -rw-r--r-- | content/templates/tags.html | 10 |
4 files changed, 119 insertions, 0 deletions
diff --git a/content/templates/base.html b/content/templates/base.html new file mode 100644 index 0000000..19c5509 --- /dev/null +++ b/content/templates/base.html @@ -0,0 +1,52 @@ +{# Page layout for org-ssg. + + Styling comes from styles.css, a verbatim copy of theme/static/styles.css — the + stylesheet weblorg already serves. org-ssg publishes assets from inside its source + directory, so the copy lives here; `diff content/styles.css theme/static/styles.css` + should stay empty, or consolidate the two if you migrate for real. + + Available here: page (.title .url .date .date_iso .tags .excerpt .toc .keywords), + site, nav, root, stylesheet. See the org-ssg guide chapter on Templates. #} +<!DOCTYPE html> +<html lang="{{ site.language }}"> +<head> +<meta charset="utf-8"> +<meta name="viewport" content="width=device-width, initial-scale=1"> +<title>{{ page.title }} · {{ site.title }}</title> +{%- if site.base_url %} +<link rel="canonical" href="{{ page.url | absolute }}"> +{%- endif %} +{%- if page.excerpt %} +<meta name="description" content="{{ page.excerpt | truncate(150) }}"> +{%- endif %} +<link rel="stylesheet" href="{{ root }}styles.css"> +{%- if stylesheet %} +<link rel="stylesheet" href="{{ stylesheet }}"> +{%- endif %} +</head> +<body> +<header> +<nav> +<ul> +<li><a href="{{ root }}index.html">{{ site.title }}</a></li> +{%- for item in nav %} +<li><a href="{{ item.url }}">{{ item.title }}</a></li> +{%- endfor %} +</ul> +</nav> +</header> +<main> +<h1>{{ page.title }}</h1> +{%- if page.date_iso %} +<p><time datetime="{{ page.date_iso }}">{{ page.date_iso }}</time></p> +{%- endif %} +{%- if page.tags %} +<p>{% for tag in page.tags %}<a href="{{ root }}tags/{{ tag }}.html">#{{ tag }}</a> {% endfor %}</p> +{%- endif %} +{% block content %}{{ body | safe }}{% endblock %} +</main> +<footer> +<p><a href="{{ root }}index.html">{{ site.title }}</a> — {{ site.description }}</p> +</footer> +</body> +</html> diff --git a/content/templates/home.html b/content/templates/home.html new file mode 100644 index 0000000..be5a0e6 --- /dev/null +++ b/content/templates/home.html @@ -0,0 +1,44 @@ +{# The home page: authored prose plus the most recent posts. + + A generated page, so it has no source .org file — `pages` holds the blog collection's + entries, newest first, and the prose lives here. This mirrors what weblorg's + theme/templates/index.html does today. #} +{% extends "base.html" %} +{% block content %} +<section> +<p>[ <a href="https://krz.sh">krz</a> · <a href="https://audit-labs.dev">audit labs</a> ]</p> +<p>Privacy · Self-Hosting · iOS</p> +<p>I build tools, write about systems, and run my own infrastructure. Focused on privacy, +user control, and long-term utility.</p> +<p><a href="{{ root }}uses/index.html">Uses</a> · <a href="{{ root }}now/index.html">Now</a></p> +</section> + +<section> +<h2>Recent Posts</h2> +<p>Things I’ve written recently.</p> +<ul class="post-list"> +{%- for entry in pages %} +{%- if loop.index <= 3 %} +<li class="post-list-item"> +{%- if entry.date_iso %}<time datetime="{{ entry.date_iso }}">{{ entry.date_iso }}</time>{% endif %} +<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a> +</li> +{%- endif %} +{%- endfor %} +</ul> +<p><a href="{{ root }}blog/index.html">All Posts →</a></p> +</section> + +<section> +<h2>Elsewhere</h2> +<p>Places to find me online.</p> +<ul> +<li>cgit (primary): <a href="https://git.krz.sh">~cmc</a></li> +<li>GitHub (mirror): <a href="https://github.com/ccleberg">@ccleberg</a></li> +<li>Email: <a href="mailto:[email protected]">[email protected]</a></li> +<li>Lemmy: <a href="https://r.nf/u/cmc">@cmc</a></li> +<li>Mastodon: <a href="https://c.im/@cmc">@cmc</a></li> +<li>Pixelfed: <a href="https://gram.social/cmc">@cmc</a></li> +</ul> +</section> +{% endblock %} diff --git a/content/templates/list.html b/content/templates/list.html new file mode 100644 index 0000000..6ff9968 --- /dev/null +++ b/content/templates/list.html @@ -0,0 +1,13 @@ +{# A listing page: the blog index, the garden index, and each tag page. + Uses the .post-list / .post-list-item classes styles.css already defines. #} +{% extends "base.html" %} +{% block content %} +<ul class="post-list"> +{%- for entry in pages %} +<li class="post-list-item"> +{%- if entry.date_iso %}<time datetime="{{ entry.date_iso }}">{{ entry.date_iso }}</time>{% endif %} +<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a> +</li> +{%- endfor %} +</ul> +{% endblock %} diff --git a/content/templates/tags.html b/content/templates/tags.html new file mode 100644 index 0000000..9702f59 --- /dev/null +++ b/content/templates/tags.html @@ -0,0 +1,10 @@ +{# The tag index at /tags/. Receives `groups` — every tag with its count — rather than + `pages`, because it lists tags and not posts. #} +{% extends "base.html" %} +{% block content %} +<ul> +{%- for tag in groups %} +<li><a href="{{ root }}{{ tag.url }}">{{ tag.name }}</a> ({{ tag.count }})</li> +{%- endfor %} +</ul> +{% endblock %} |
