diff options
| author | Christian Cleberg <[email protected]> | 2026-08-11 13:41:18 -0500 |
|---|---|---|
| committer | Christian Cleberg <[email protected]> | 2026-08-11 13:41:18 -0500 |
| commit | ad2d5934148e17efa20e77879ddd45950209852b (patch) | |
| tree | f5f79818374a6d991182d4dc408c38d421414f2c /content/templates/base.html | |
| parent | 7e5c882d888ed7d4d635480a2dec92b4a3e7ddf8 (diff) | |
| download | cleberg.net-ad2d5934148e17efa20e77879ddd45950209852b.tar.gz cleberg.net-ad2d5934148e17efa20e77879ddd45950209852b.tar.bz2 cleberg.net-ad2d5934148e17efa20e77879ddd45950209852b.zip | |
Bring the org-ssg templates to parity with the live site
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
<title> 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.
Diffstat (limited to 'content/templates/base.html')
| -rw-r--r-- | content/templates/base.html | 74 |
1 files changed, 51 insertions, 23 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 }} · {{ 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 <[email protected]>"> +<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 %} · {{ 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 →</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> — {{ site.description }}</p> +<a href="https://git.krz.sh/cmc/cleberg.net.git/">Source</a> · +<a href="{{ root }}feed.xml">RSS</a> · +<a href="http://paske4urhs6nttrtlkuwa5cowum3fjkc6yv6kl4ncx3mjxcd77764nqd.onion/">Onion</a> · +<a href="{{ root }}tips/index.html">Tips</a> · +<a href="https://iheartrss.com/">I ♥ RSS</a> +<p>[ <a href="https://krz.sh">krz</a> · <a href="https://audit-labs.dev">audit labs</a> ]</p> </footer> </body> </html> |
