aboutsummaryrefslogtreecommitdiff
path: root/content/templates
diff options
context:
space:
mode:
Diffstat (limited to 'content/templates')
-rw-r--r--content/templates/base.html74
-rw-r--r--content/templates/blog.html16
-rw-r--r--content/templates/feed.xml36
-rw-r--r--content/templates/garden.html30
-rw-r--r--content/templates/home.html9
-rw-r--r--content/templates/tags.html8
6 files changed, 144 insertions, 29 deletions
diff --git a/content/templates/base.html b/content/templates/base.html
index 19c5509..c012e65 100644
--- a/content/templates/base.html
+++ b/content/templates/base.html
@@ -1,52 +1,80 @@
-{# Page layout for org-ssg.
+{# Page layout for org-ssg, mirroring theme/templates/base.html.
- 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.
+ Styling comes from styles.css, copied here from theme/static/ along with gpg.txt,
+ robots.txt and salary.csv — org-ssg publishes assets from inside its source
+ directory, and weblorg's live static root is theme/static/. The copies should stay
+ identical: `diff content/styles.css theme/static/styles.css` and friends should
+ print nothing, or consolidate the two if you migrate for real. weblorg links the
+ minified styles.min.css instead; that file is gitignored build output, and the rules
+ are the same, so the tracked stylesheet is the one to publish from here.
- Available here: page (.title .url .date .date_iso .tags .excerpt .toc .keywords),
- site, nav, root, stylesheet. See the org-ssg guide chapter on Templates. #}
+ Available here: page (.title .url .source .date .date_iso .tags .excerpt .toc
+ .keywords), site, nav, root, stylesheet. See the org-ssg guide on Templates. #}
<!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">
-<title>{{ page.title }} &middot; {{ 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">
+<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>
-<header>
-<nav>
+<a href="#main-content" class="skip-link">Skip to content</a>
+
+<nav aria-label="Site Navigation">
<ul>
-<li><a href="{{ root }}index.html">{{ site.title }}</a></li>
+<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>
-</header>
-<main>
+
+<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></p>
+<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 %}
-{% block content %}{{ body | safe }}{% endblock %}
+<div>{% block content %}{{ body | safe }}{% endblock %}</div>
+{#- Blog posts carry a reply footer; other pages do not. org-ssg has no per-page
+ template selection, so the page's own URL is what tells them apart. #}
+{%- if page.url is startingwith("blog/") %}
+<div><a href="mailto:[email protected]">Reply via email &rarr;</a></div>
+<div><i>...or, comment on this post on <a href="https://bubbles.town/source/cleberg.net">Bubbles</a>!</i></div>
+{%- endif %}
+</article>
+{% endblock %}
</main>
+
<footer>
-<p><a href="{{ root }}index.html">{{ site.title }}</a> &mdash; {{ site.description }}</p>
+<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>
diff --git a/content/templates/blog.html b/content/templates/blog.html
new file mode 100644
index 0000000..ad6720a
--- /dev/null
+++ b/content/templates/blog.html
@@ -0,0 +1,16 @@
+{# The blog index at /blog/, mirroring theme/templates/blog.html.
+ Separate from list.html because the live page carries its own prose. #}
+{% extends "base.html" %}
+{% block main %}
+<h1>{{ page.title }}</h1>
+<p>Use <code>&#8984; F</code> / <code>Ctrl F</code> to search &middot; <a href="{{ root }}feed.xml">RSS Feed</a></p>
+<p>Want to browse by topic instead? Head over to the <a href="{{ root }}tags/index.html">tags</a> page.</p>
+<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/feed.xml b/content/templates/feed.xml
new file mode 100644
index 0000000..0319910
--- /dev/null
+++ b/content/templates/feed.xml
@@ -0,0 +1,36 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+{#- The RSS feed at /feed.xml, mirroring theme/templates/feed.xml. A feed is read away
+ from the site that served it, so every URL here is absolute — which is what
+ `| absolute` needs [site] base_url for.
+
+ One difference from weblorg: <description> carries each post's excerpt rather than its
+ full HTML. org-ssg gives a collection template each entry's metadata, not its rendered
+ body. #}
+<rss version="2.0"
+ xmlns:content="http://purl.org/rss/1.0/modules/content/"
+ xmlns:dc="http://purl.org/dc/elements/1.1/"
+ xmlns:atom="http://www.w3.org/2005/Atom">
+ <channel>
+ <title>{{ site.title }}</title>
+ <atom:link href="{{ page.url | absolute }}" rel="self" type="application/rss+xml" />
+ <link>{{ "index.html" | absolute | replace("index.html", "") }}</link>
+ <description>{{ site.description }}</description>
+ <language>{{ site.language }}</language>
+ <webMaster>[email protected] (Christian Cleberg)</webMaster>
+{%- for post in pages %}
+ <item>
+ <title>{{ post.title }}</title>
+ <link>{{ post.url | absolute }}</link>
+ <guid isPermaLink="true">{{ post.url | absolute }}</guid>
+ <author>[email protected] (Christian Cleberg)</author>
+{%- if post.date_iso %}
+ <pubDate>{{ post.date_iso | rfc822 }}</pubDate>
+{%- endif %}
+{%- for tag in post.tags %}
+ <category>{{ tag }}</category>
+{%- endfor %}
+ <description>{{ post.excerpt }}</description>
+ </item>
+{%- endfor %}
+ </channel>
+</rss>
diff --git a/content/templates/garden.html b/content/templates/garden.html
new file mode 100644
index 0000000..9d21248
--- /dev/null
+++ b/content/templates/garden.html
@@ -0,0 +1,30 @@
+{# The garden index at /garden/, mirroring theme/templates/garden.html.
+ Notes are listed by title and description rather than by date. #}
+{% extends "base.html" %}
+{% block main %}
+<h1>{{ page.title }}</h1>
+<p>Notes in various states of growth. Some are stubs, some are developed. Browse
+around.</p>
+<section>
+<h2>&#127795; The Growth Stages</h2>
+<p>Instead of dates, these metadata labels show how mature a page is:</p>
+<span><strong>&#127793; Seedlings:</strong> Rough notes, raw ideas, or "half-baked"
+thoughts.</span><br>
+<span><strong>&#127807; Budding:</strong> Notes that have some structure and a few
+internal links.</span><br>
+<span><strong>&#127795; Evergreen:</strong> High-conviction ideas that are
+well-researched and stable.</span><br>
+<span><strong>&#127810; Compost:</strong> Ideas you no longer agree with but want to
+keep for historical context.</span><br><br>
+</section>
+<ul>
+{%- for entry in pages %}
+<li>
+<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a>
+{%- if entry.excerpt %}
+<span>{{ entry.excerpt }}</span>
+{%- endif %}
+</li>
+{%- endfor %}
+</ul>
+{% endblock %}
diff --git a/content/templates/home.html b/content/templates/home.html
index be5a0e6..8333312 100644
--- a/content/templates/home.html
+++ b/content/templates/home.html
@@ -2,10 +2,13 @@
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. #}
+ theme/templates/index.html does today, including its bare <title>: the home page is
+ "cleberg.net" and not "cleberg.net - cleberg.net". #}
{% extends "base.html" %}
-{% block content %}
+{% block subtitle %}{% endblock %}
+{% block main %}
<section>
+<h1>{{ page.title }}</h1>
<p>[ <a href="https://krz.sh">krz</a> &middot; <a href="https://audit-labs.dev">audit labs</a> ]</p>
<p>Privacy &middot; Self-Hosting &middot; iOS</p>
<p>I build tools, write about systems, and run my own infrastructure. Focused on privacy,
@@ -35,7 +38,7 @@ user control, and long-term utility.</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>Email: <a href="mailto:[email protected]">[email protected]</a> (<a href="{{ root }}gpg.txt">GPG</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>
diff --git a/content/templates/tags.html b/content/templates/tags.html
index 9702f59..094d1f6 100644
--- a/content/templates/tags.html
+++ b/content/templates/tags.html
@@ -1,7 +1,9 @@
-{# The tag index at /tags/. Receives `groups` — every tag with its count — rather than
- `pages`, because it lists tags and not posts. #}
+{# The tag index at /tags/, mirroring theme/templates/tags.html. Receives `groups` —
+ every tag with its count — rather than `pages`, because it lists tags and not posts. #}
{% extends "base.html" %}
-{% block content %}
+{% block main %}
+<h1>{{ page.title }}</h1>
+<p>Browse posts by topic.</p>
<ul>
{%- for tag in groups %}
<li><a href="{{ root }}{{ tag.url }}">{{ tag.name }}</a> ({{ tag.count }})</li>