Commit 713120aac5

713120aac59fc5f3e8ca2e2b6d9269b34a0f2ee5

parent: 7c114f1212

Verified · cmc

cmc <hello@cleberg.net> · 2026-09-15 23:12 UTC

Add detour series: tag, post convention, index, styling

Special blocks already export as <div class="detour"> around a <dl>, so
this needs no orgo change.

- content/templates/detour.html: series index, holds the rating scale
- content/templates/detour.org: post template (dir is not published)
- content/orgo.toml: /detour/ collection, filtered by tag in the
  template because collections select by directory
- theme/static/styles.css: .detour and .detour-list rules

Layout: unified · split

content/orgo.toml +13 −1
@@ -25,7 +25,7 @@ base_url = "https://cleberg.net"
25# listed here gets appended after everything that is — which is why the tags collection 25# listed here gets appended after everything that is — which is why the tags collection
26# below does not set `nav = true`: the live nav has no Tags entry. 26# below does not set `nav = true`: the live nav has no Tags entry.
27mode = "explicit" 27mode = "explicit"
28pages = ["blog/index.html", "garden/index.html", "salary/index.org"] 28pages = ["blog/index.html", "garden/index.html", "detour/index.html", "salary/index.org"]
29 29
30[build] 30[build]
31# theme/static/ is the site's static root, published at /. orgo reads it from here 31# theme/static/ is the site's static root, published at /. orgo reads it from here
@@ -97,6 +97,18 @@ sort = "date"
97order = "desc" 97order = "desc"
98nav = true 98nav = true
99 99
100# The detour series index. `source` is blog rather than a directory of its own, because
101# these are ordinary blog posts — they belong in the blog index and the feed — and a
102# collection cannot select by tag. detour.html does that filtering itself.
103[[collections]]
104source = "blog"
105output = "detour/index.html"
106template = "detour.html"
107title = "detour"
108sort = "date"
109order = "asc"
110nav = true
111
100# One page per tag, plus the index the live site already has at /tags/. `source` is empty 112# One page per tag, plus the index the live site already has at /tags/. `source` is empty
101# so it groups across the whole site rather than one section, which is how #+FILETAGS: is 113# so it groups across the whole site rather than one section, which is how #+FILETAGS: is
102# used here — tags appear on blog posts and garden notes alike. 114# used here — tags appear on blog posts and garden notes alike.
content/templates/detour.html added +42
@@ -0,0 +1,42 @@
1{# The detour series index at /detour/.
2
3 Receives every blog post and filters to the ones tagged `detour`, because a
4 collection selects by directory and these posts live in blog/ with everything else —
5 they belong in the blog index and the feed like any other post.
6
7 Number and name come from the title (`detour #001: Name`). Location and rating come
8 from `#+LOCATION:` and `#+RATING:`, which the post also states in its own metadata
9 block; a listing cannot read prose, so the two structured fields are repeated as
10 keywords.
11
12 The rating prints stars and the "N/5" text both. Stars alone would reach a screen
13 reader as a run of unexplained symbols. #}
14{% extends "base.html" %}
15{% block main %}
16<h1>{{ page.title }}</h1>
17<p>Museums, roadside attractions, public art, and local landmarks worth leaving
18the highway for. One post per place.</p>
19
20<h2>Rating scale</h2>
21<dl>
22<dt>★☆☆☆☆ (1/5)</dt><dd>Only if you're already in the parking lot.</dd>
23<dt>★★☆☆☆ (2/5)</dt><dd>Worth a stop if it's on your route.</dd>
24<dt>★★★☆☆ (3/5)</dt><dd>Worth a short detour, under 30 minutes.</dd>
25<dt>★★★★☆ (4/5)</dt><dd>Worth planning an afternoon around.</dd>
26<dt>★★★★★ (5/5)</dt><dd>Worth a dedicated road trip.</dd>
27</dl>
28
29<h2>The list</h2>
30<ul class="detour-list">
31{%- for entry in pages if "detour" in entry.tags %}
32<li>
33<a href="{{ root }}{{ entry.url }}">{{ entry.title }}</a>
34<span class="detour-meta">
35{%- if entry.keywords.location %}{{ entry.keywords.location }}{% endif %}
36{%- if entry.keywords.location and entry.keywords.rating %} · {% endif %}
37{%- if entry.keywords.rating %}{{ "★" * entry.keywords.rating | int }}{{ "☆" * (5 - entry.keywords.rating | int) }} ({{ entry.keywords.rating }}/5){% endif %}
38</span>
39</li>
40{%- endfor %}
41</ul>
42{% endblock %}
content/templates/detour.org added +29
@@ -0,0 +1,29 @@
1# Starting point for a detour post. Copy to content/blog/YYYY-MM-DD-detour-NNN-slug.org
2# and fill in. This directory is not published, so the file is not a page.
3#
4# NNN is zero-padded and sequential. #+LOCATION: and #+RATING: are what the series index
5# at /detour/ reads; the block below is what the reader sees. Keep them in agreement.
6#
7# Ratings: 1 only if you're already in the parking lot, 2 worth a stop if it's on your
8# route, 3 worth a short detour under 30 minutes, 4 worth planning an afternoon around,
9# 5 worth a dedicated road trip.
10
11#+date: [YYYY-MM-DD Day 00:00:00]
12#+title: detour #NNN: NAME
13#+description:
14#+slug: detour-NNN-SLUG
15#+filetags: :detour:
16#+location: CITY, ST
17#+rating: N
18
19#+begin_detour
20- Location :: CITY, ST · [[OSM_URL][map]]
21- Admission :: PRICES (as of YYYY-MM)
22- Hours :: SUMMARY; check the [[OFFICIAL_URL][official site]]
23- Visited :: YYYY-MM
24- Worth the drive :: ★★★★☆ (N/5)
25#+end_detour
26
27* Overview
28
29* Going
theme/static/styles.css +9
@@ -18,6 +18,15 @@ pre { overflow: auto; white-space: pre; }
18blockquote p { margin: 0; margin-bottom: 1rem; } 18blockquote p { margin: 0; margin-bottom: 1rem; }
19blockquote p:last-child { margin-bottom: 0; } 19blockquote p:last-child { margin-bottom: 0; }
20code { color: #942192; } 20code { color: #942192; }
21/* The metadata block on a detour post. currentColor for the rule, so the dark scheme
22 below needs no override. */
23.detour { border-left: 3px solid currentColor; padding: .5rem 1rem; margin: 1rem 0 2rem; font-size: .95em; }
24.detour dl { margin: 0; }
25.detour dt { font-weight: bold; }
26.detour dd { margin: 0 0 .4rem 0; }
27.detour-list { padding-inline-start: 0; }
28.detour-list li { list-style: none; margin-bottom: .75rem; }
29.detour-meta { display: block; font-size: .95em; }
21/* Blocks are coloured by syntax.css, so this is only the fallback for the tokens it 30/* Blocks are coloured by syntax.css, so this is only the fallback for the tokens it
22 leaves unclassified: the highlight theme's own foreground rather than inline code's. */ 31 leaves unclassified: the highlight theme's own foreground rather than inline code's. */
23pre code { color: #323232; } 32pre code { color: #323232; }