add the gallery shortcode and the seam it needed
A feature now learns which bundle is rendering: render.Bundle puts an Origin —
the bundle's directory plus the rooted fs.FS — on the parse context, and
render.OriginFrom reads it back. Available while parsing, not while rendering,
which decides where a feature does its filesystem work: goldmark hands the
context to a block parser and not to a node renderer, so gallery gathers its
filenames at parse time and carries them on the node.
Reads stay inside the site root because Origin passes the fs.FS rather than a
path to join (ADR-0031).
Fragment{Args, Items} lands with it (ADR-0037), so figure's template now reads
.Args.src. Authored arguments and engine-gathered items stay in separate fields:
a src argument beside a src the engine found would otherwise silently pick one.
A gallery is pictures beside the bundle, in filename order, skipping
subdirectories and anything a browser cannot show. Filename order is what makes
the sparse numeric-prefix convention work without numbers in URLs (ADR-0016).
New latent row: the reference theme's images carry no width/height and a
gallery's carry no alt, which is below the output floor conventions.md states.
Nothing can supply either yet — dimensions need the image read, and a filename is
not alt text. Queue 13 computes dimensions and brings structured items with it.
This commit is contained in:
@@ -281,10 +281,14 @@ and logs it — one typo does not take a page down (ADR-0029).
|
||||
|
||||
Shortcodes run on site-root content only (ADR-0003), never on anything untrusted.
|
||||
|
||||
`figure` exists. `include` and `gallery` are `[spec]`: both need the including bundle's directory, which is
|
||||
context the parser does not carry yet. File inclusion will resolve relative to the including bundle and may
|
||||
not escape the site root. Transclusion of another bundle's body is Arc 4 and needs a cycle guard on the
|
||||
first attempt.
|
||||
`figure` and `gallery` exist. `{{< gallery >}}` takes no arguments: it lists the pictures sitting beside the
|
||||
bundle, in filename order, which is why the sparse numeric-prefix convention orders a set without putting
|
||||
numbers in URLs (ADR-0016). A subdirectory is not part of the gallery, and neither is a file the browser
|
||||
cannot show.
|
||||
|
||||
`include` is `[spec]`: file inclusion will resolve relative to the including bundle, may not escape the site
|
||||
root, and needs a depth limit on the first attempt, since a file that includes itself is otherwise a crash.
|
||||
Transclusion of another bundle's body is Arc 4 and needs a cycle guard too.
|
||||
|
||||
## Images `[spec]`
|
||||
|
||||
|
||||
Reference in New Issue
Block a user