From 9049e20a29fb54245079ec19ae4a503e3f8e2799 Mon Sep 17 00:00:00 2001 From: Christian Cleberg Date: Tue, 11 Aug 2026 13:41:18 -0500 Subject: Bring the org-ssg templates to parity with the live site MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The org-ssg build rendered the right content in the wrong chrome. Closing every difference found by comparing it against theme/templates/ and the live pages: - base.html: Home link written by the layout rather than the site title, a of "Page - cleberg.net" (bare "cleberg.net" on the home page, via a subtitle block), author/description/og meta, the RSS alternate link, four rel="me" identity links, favicon, skip link, <main id="main-content">, aria-label on the nav, and the real footer. - home.html: the h1 is "Christian Cleberg" (the collection's title), and the email line has its GPG link back. - blog.html and garden.html: the two listings carry their own prose on the live site — the search/RSS hint, and the garden's growth stages — so they are no longer sharing the generic list.html. Tag pages still use it. - tags.html: "Browse posts by topic." - Blog posts get the reply-by-email and Bubbles lines. org-ssg has no per-page template selection, so the layout keys off the page's URL prefix. - Tags leaves the nav, which the live site does not have. feed.xml is new: the footer links /feed.xml and nothing was generating it. It is a collection whose template happens to be XML. Its <description> carries each post's excerpt rather than the full rendered body, which weblorg's feed does include — a collection template gets each entry's metadata, not its HTML. base_url is now set, since canonical links and a feed cannot be relative. Page links stay relative, so a preview build still works from any directory. gpg.txt, robots.txt and salary.csv are copied in from theme/static/: weblorg publishes that directory to the site root, and org-ssg publishes from content/, so /gpg.txt was a 404. styles.min.css is deliberately not copied — it is gitignored build output, and the tracked styles.css holds the same rules. --- content/templates/base.html | 74 +++++++++++++++++++++++++++++-------------- content/templates/blog.html | 16 ++++++++++ content/templates/feed.xml | 36 +++++++++++++++++++++ content/templates/garden.html | 30 ++++++++++++++++++ content/templates/home.html | 9 ++++-- content/templates/tags.html | 8 +++-- 6 files changed, 144 insertions(+), 29 deletions(-) create mode 100644 content/templates/blog.html create mode 100644 content/templates/feed.xml create mode 100644 content/templates/garden.html (limited to 'content/templates') 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 }} -{{ page.title }} · {{ site.title }} -{%- if site.base_url %} - -{%- endif %} -{%- if page.excerpt %} - -{%- endif %} - + + + + + + + + + +{#- rel="me" identity links. weblorg's base.html writes the last one as , which a + browser hoists out of ; is the spelling that stays where it is put. #} + + + + {%- if stylesheet %} {%- endif %} -
-
-
+ +
+{% block main %} +

{{ page.title }}

{%- if page.date_iso %} -

+

{% if page.excerpt %} · {{ page.excerpt }}{% endif %}

{%- endif %} {%- if page.tags %}

{% for tag in page.tags %}#{{ tag }} {% endfor %}

{%- endif %} -{% block content %}{{ body | safe }}{% endblock %} +
{% block content %}{{ body | safe }}{% endblock %}
+{#- 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/") %} +
Reply via email →
+
...or, comment on this post on Bubbles!
+{%- endif %} +
+{% endblock %}
+ 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 %} +

{{ page.title }}

+

Use ⌘ F / Ctrl F to search · RSS Feed

+

Want to browse by topic instead? Head over to the tags page.

+ +{% 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 @@ + +{#- 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: carries each post's excerpt rather than its + full HTML. org-ssg gives a collection template each entry's metadata, not its rendered + body. #} + + + {{ site.title }} + + {{ "index.html" | absolute | replace("index.html", "") }} + {{ site.description }} + {{ site.language }} + hello@cleberg.net (Christian Cleberg) +{%- for post in pages %} + + {{ post.title }} + {{ post.url | absolute }} + {{ post.url | absolute }} + hello@cleberg.net (Christian Cleberg) +{%- if post.date_iso %} + {{ post.date_iso | rfc822 }} +{%- endif %} +{%- for tag in post.tags %} + {{ tag }} +{%- endfor %} + {{ post.excerpt }} + +{%- endfor %} + + 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 %} +

{{ page.title }}

+

Notes in various states of growth. Some are stubs, some are developed. Browse +around.

+
+

🌳 The Growth Stages

+

Instead of dates, these metadata labels show how mature a page is:

+🌱 Seedlings: Rough notes, raw ideas, or "half-baked" +thoughts.
+🌿 Budding: Notes that have some structure and a few +internal links.
+🌳 Evergreen: High-conviction ideas that are +well-researched and stable.
+🍂 Compost: Ideas you no longer agree with but want to +keep for historical context.

+
+
    +{%- for entry in pages %} +
  • +{{ entry.title }} +{%- if entry.excerpt %} +{{ entry.excerpt }} +{%- endif %} +
  • +{%- endfor %} +
+{% 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 : 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> · <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, @@ -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:hello@cleberg.net">hello@cleberg.net</a></li> +<li>Email: <a href="mailto:hello@cleberg.net">hello@cleberg.net</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> -- cgit v1.2.3