Add detour series: tag, post convention, index, styling !4
merged
merged by cmc on 2026-09-16 03:30 UTC
· cmc/cleberg.net:detour-series into main
4 files changed, +94 −0
Layout: unified · split
content/orgo.toml
+14
| @@ -97,6 +97,20 @@ sort = "date" |
| 97 | 97 | order = "desc" |
| 98 | 98 | nav = 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 | # |
| 104 | # Deliberately out of the nav: `nav = true` is absent and [nav] does not list it, which |
| 105 | # are both required to keep it out. Posts link to it; the nav does not. |
| 106 | [[collections]] |
| 107 | source = "blog" |
| 108 | output = "detour/index.html" |
| 109 | template = "detour.html" |
| 110 | title = "detour" |
| 111 | sort = "date" |
| 112 | order = "asc" |
| 113 | |
| 100 | 114 | # One page per tag, plus the index the live site already has at /tags/. `source` is empty |
| 101 | 115 | # so it groups across the whole site rather than one section, which is how #+FILETAGS: is |
| 102 | 116 | # 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 |
| 18 | the 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; } |
| 18 | 18 | blockquote p { margin: 0; margin-bottom: 1rem; } |
| 19 | 19 | blockquote p:last-child { margin-bottom: 0; } |
| 20 | 20 | code { 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 | 30 | /* Blocks are coloured by syntax.css, so this is only the fallback for the tokens it |
| 22 | 31 | leaves unclassified: the highlight theme's own foreground rather than inline code's. */ |
| 23 | 32 | pre code { color: #323232; } |