Commit 3239e8978f
3239e8978f879af87a928866163173f66127e9f1
parent: c156621a77
Unsigned
cmc <hello@cleberg.net> · 2026-08-11 21:12 UTC
Make the reply footer a snippet, not a rule
Routing garden notes and /now/ through post.html put the invitation to reply on
them because a directory said so, which is the wrong thing to be automatic — it
is a choice about each page, and I had made it site-wide to chase parity with
the live site.
Those two rules are gone; blog posts keep it. The wording now lives in
templates/reply.html rather than inside post.html, so it can be edited or
emptied without touching how a post is built, and editing it re-renders the 170
pages that include it and nothing else.
Any page opts in for itself with `#+TEMPLATE: post.html`; any post opts out with
`#+TEMPLATE: base.html`.
Layout: unified · split
content/org-ssg.toml
+4 −10
| @@ -41,20 +41,14 @@ dir = "templates" |
| 41 | |
41 | |
| 42 | # Blog posts render through post.html — the shared layout plus a reply footer — the way |
42 | # Blog posts render through post.html — the shared layout plus a reply footer — the way |
| 43 | # weblorg routes them through theme/templates/post.html. Everything else uses base.html. |
43 | # weblorg routes them through theme/templates/post.html. Everything else uses base.html. |
| |
44 | # Blog posts render through post.html, which adds the reply snippet. Nothing else does: |
| |
45 | # the live site also invites replies on garden notes and /now/, and that is a choice |
| |
46 | # rather than something a directory should decide. Any page opts in for itself with |
| |
47 | # `#+TEMPLATE: post.html`, and any post opts out with `#+TEMPLATE: base.html`. |
| 44 | [[pages]] |
48 | [[pages]] |
| 45 | match = "blog" |
49 | match = "blog" |
| 46 | template = "post.html" |
50 | template = "post.html" |
| 47 | |
51 | |
| 48 | # The live site invites replies on garden notes and /now/ too, but not on /uses/, |
| |
| 49 | # /tips/ or /salary/. |
| |
| 50 | [[pages]] |
| |
| 51 | match = "garden" |
| |
| 52 | template = "post.html" |
| |
| 53 | |
| |
| 54 | [[pages]] |
| |
| 55 | match = "now" |
| |
| 56 | template = "post.html" |
| |
| 57 | |
| |
| 58 | [highlight] |
52 | [highlight] |
| 59 | theme = "InspiredGitHub" |
53 | theme = "InspiredGitHub" |
| 60 | |
54 | |
content/templates/post.html
+4 −6
| @@ -1,11 +1,9 @@ |
| 1 | {# A blog post, mirroring theme/templates/post.html. Everything but the reply footer is |
1 | {# A blog post: the shared layout plus the reply snippet. |
| 2 | the shared layout, so this extends it rather than restating it. |
| |
| 3 | |
2 | |
| 4 | Selected by the [[pages]] rule for blog/ in org-ssg.toml; a post that wants a different |
3 | The snippet lives in reply.html so its wording is a file you edit rather than a line |
| 5 | layout says so with #+TEMPLATE:. #} |
4 | buried in a layout — and so emptying that file removes it from every post at once. #} |
| 6 | {% extends "base.html" %} |
5 | {% extends "base.html" %} |
| 7 | {% block content %} |
6 | {% block content %} |
| 8 | {{ body | safe }} |
7 | {{ body | safe }} |
| 9 | <div><a href="mailto:hello@cleberg.net">Reply via email →</a></div> |
8 | {% include "reply.html" %} |
| 10 | <div><i>...or, comment on this post on <a href="https://bubbles.town/source/cleberg.net">Bubbles</a>!</i></div> |
| |
| 11 | {% endblock %} |
9 | {% endblock %} |
content/templates/reply.html
added
+8
| @@ -0,0 +1,8 @@ |
| |
1 | {# The invitation to reply, kept apart from the layout so it can be edited, emptied or |
| |
2 | dropped without touching how a post is built. |
| |
3 | |
| |
4 | Included by post.html, which the [[pages]] rule routes blog posts through. A page that |
| |
5 | wants it elsewhere says `#+TEMPLATE: post.html` for itself; a post that does not want |
| |
6 | it says `#+TEMPLATE: base.html`. #} |
| |
7 | <div><a href="mailto:hello@cleberg.net">Reply via email →</a></div> |
| |
8 | <div><i>...or, comment on this post on <a href="https://bubbles.town/source/cleberg.net">Bubbles</a>!</i></div> |