Render built-in macros from bundled Liquid macro templates (parity with bDS2) #68
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Source: Audit section 1.4 (high impact).
Spec:
specs/rendering.alliumrule ExpandBuiltinMacros: each macro "renders a bundled macro template (macros/{name}) in an isolated Liquid subscope" (invariant MacroIsolation). Macros: youtube, vimeo, gallery, photo_archive (template macros/photo-archive), tag_cloud (macros/tag-cloud).bDS2: ships
../bDS2/priv/starter_templates/templates/macros/{youtube,vimeo,gallery,photo-archive,tag-cloud}.liquidand renders them via the Liquid engine.Current behaviour (RuDS):
crates/bds-core/src/render/macros.rsbuilds the HTML in Rust format! strings;assets/starter-templates/has no macros/ directory. Consequences: (a) output HTML parity with bDS2 is unverified, (b) no template-based override/customization path, (c) at least one hardcoded English string ("Missing Vimeo video id." inrender_vimeo) violating i18n rules.Task:
assets/starter-templates/macros/(bring assets into the project, no CDN refs).renderdomain translations (locales/render/*.ftl).Acceptance: Macro HTML matches bDS2 output for fixtures; macro templates live as assets; i18n clean; existing macro tests updated.
Implemented in
8170076. Added the five bundled macro Liquid templates and routed every built-in macro through isolated Liquid assigns with bDS2-compatible HTML, data shaping, URI encoding, and localized defaults/empty states. Project partial templates with macros/* slugs now override the bundled defaults. Preserved gallery and tag-cloud bounds, orientation aliases, photo-archive filters, published tag weights, and colours. Verified with bDS2 fixture parity tests, isolated-scope and override integration tests, supported-Liquid validation, cargo fmt, clippy with warnings denied, cargo build --workspace, cargo test --workspace, and Allium check/analyse with no errors or findings.