diff options
Diffstat (limited to 'content/templates')
| -rw-r--r-- | content/templates/base.html | 8 | ||||
| -rw-r--r-- | content/templates/feed.xml | 7 | ||||
| -rw-r--r-- | content/templates/garden.html | 2 | ||||
| -rw-r--r-- | content/templates/tags.html | 15 |
4 files changed, 20 insertions, 12 deletions
diff --git a/content/templates/base.html b/content/templates/base.html index e391e8d..090cbea 100644 --- a/content/templates/base.html +++ b/content/templates/base.html @@ -8,12 +8,14 @@ Available here: page (.title .url .source .date .date_iso .tags .excerpt .toc .keywords), site, nav, root, stylesheet. See the org-ssg guide on Templates. #} {#- The table of contents, in the shape Emacs exports it. `page.toc` is a tree of - {title, anchor, level, children}, and it is empty when the page has no headings or - says `#+OPTIONS: toc:nil` — so pages that opt out simply render nothing here. #} + {title, anchor, level, number, children}, and it is empty when the page has no + headings or says `#+OPTIONS: toc:nil` — so pages that opt out render nothing here. + The number is printed because [html] section_numbers is on; drop it if you turn + numbering off, or the contents will number what the headings do not. #} {%- macro toc_list(entries) -%} <ul> {%- for e in entries %} -<li><a href="#{{ e.anchor }}">{{ e.title }}</a> +<li><a href="#{{ e.anchor }}">{{ e.number }} {{ e.title }}</a> {%- if e.children %}{{ toc_list(e.children) }}{% endif %}</li> {%- endfor %} </ul> diff --git a/content/templates/feed.xml b/content/templates/feed.xml index 0319910..fa761b8 100644 --- a/content/templates/feed.xml +++ b/content/templates/feed.xml @@ -3,9 +3,8 @@ 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: <description> carries each post's excerpt rather than its - full HTML. org-ssg gives a collection template each entry's metadata, not its rendered - body. #} + <description> carries each post's full rendered HTML, as weblorg's feed does — the + collection sets `include_content` to ask for it. #} <rss version="2.0" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" @@ -29,7 +28,7 @@ {%- for tag in post.tags %} <category>{{ tag }}</category> {%- endfor %} - <description>{{ post.excerpt }}</description> + <description><![CDATA[{{ post.content | safe }}]]></description> </item> {%- endfor %} </channel> diff --git a/content/templates/garden.html b/content/templates/garden.html index 9d21248..dc669a2 100644 --- a/content/templates/garden.html +++ b/content/templates/garden.html @@ -6,7 +6,7 @@ <p>Notes in various states of growth. Some are stubs, some are developed. Browse around.</p> <section> -<h2>🌳 The Growth Stages</h2> +<h2>🪴 The Growth Stages</h2> <p>Instead of dates, these metadata labels show how mature a page is:</p> <span><strong>🌱 Seedlings:</strong> Rough notes, raw ideas, or "half-baked" thoughts.</span><br> diff --git a/content/templates/tags.html b/content/templates/tags.html index 094d1f6..5240b27 100644 --- a/content/templates/tags.html +++ b/content/templates/tags.html @@ -1,12 +1,19 @@ -{# 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. #} +{# The tag index at /tags/. Receives `groups` — every tag with its count — rather than + `pages`, because it lists tags and not posts. + + This deliberately differs in shape from the live weblorg page, which is one page with + every post inlined under an `#anchor` per tag. Here each tag is its own page, so a tag + has a URL worth linking to and the index stays short. The `id` on each entry keeps the + old `/tags/#audit` links landing in the right place — they scroll to the tag and its + link, rather than 404ing or dumping the reader at the top of a long page. #} {% extends "base.html" %} {% block main %} <h1>{{ page.title }}</h1> <p>Browse posts by topic.</p> -<ul> +<ul class="tag-toc"> {%- for tag in groups %} -<li><a href="{{ root }}{{ tag.url }}">{{ tag.name }}</a> ({{ tag.count }})</li> +<li id="{{ tag.slug }}"><a href="{{ root }}{{ tag.url }}">{{ tag.name }}</a> +<span class="tag-count">({{ tag.count }})</span></li> {%- endfor %} </ul> {% endblock %} |
