split the theme's fragments into a directory, keeping the file form
One file held every fragment, and it gained one per feature all session: figure, gallery, icon, three admonitions, details, aside, contents. A theme author overriding one had to copy the file or redefine into it, and a diff of the theme became a diff of everything. Both forms are supported, because a small theme is happier with one file and the contract should not force a directory on it. Parse order is embedded file, embedded directory, site file, site directory, and the last definition wins — so the directory overrides the file within one source and a site overrides the binary either way. Verified with a site root using both at once: its shortcodes.html supplied `icon`, its shortcodes/note.html supplied `note`, the embedded directory supplied the rest, and with the same name in both the directory won. The embedded theme ships the directory only, seven files, so nothing is defined twice. parseSet takes globs now and lost a branch doing it. Its old guard — a literal embedded name must exist — had to go, since shortcodes.html is deliberately absent; the replacement is stronger, failing at startup when a set matches nothing anywhere, which also catches a renamed base.html.
This commit is contained in:
@@ -0,0 +1,13 @@
|
||||
{{/* A flat list with a level class per entry, so nesting is a CSS decision rather than a markup one: the
|
||||
engine supplies depth and the theme decides whether to indent (ADR-0065). An entry with no id is
|
||||
skipped rather than linked nowhere. */}}
|
||||
{{define "toc"}}
|
||||
{{- if .Headings}}<nav class="toc" aria-label="{{t .Lang "contents"}}">
|
||||
<p class="toc-title">{{t .Lang "contents"}}</p>
|
||||
<ol>
|
||||
{{- range .Headings}}{{if .ID}}
|
||||
<li class="toc-{{.Level}}"><a href="#{{.ID}}">{{.Text}}</a></li>
|
||||
{{- end}}{{end}}
|
||||
</ol></nav>
|
||||
{{- end}}
|
||||
{{- end}}
|
||||
Reference in New Issue
Block a user