-
Notifications
You must be signed in to change notification settings - Fork 3
Description
Motivation
In the process of converting existing Jekyll liquid templates into Relaton's vanilla liquid templates, I found the need to supply data that was not provided in build_liquid_document():
relaton-cli/lib/relaton/cli/xml_to_html_renderer.rb
Lines 54 to 62 in 1c5170d
| hash_to_liquid( | |
| depth: 2, | |
| css: stylesheet, | |
| title: bibcollection.title, | |
| date: Date.today.to_s, | |
| metanorma_v: mnv.lines.first&.strip, | |
| author: bibcollection.author, | |
| documents: document_items(bibcollection) | |
| ) |
Examples include the domain name of the deployed site, for the construction of the canonical URL link element.
Proposals
A. Add a CLI param that accepts a YAML / JSON file, which will be merged into the arguments for hash_to_liquid(...), making its contents available inside custom liquid templates.
B. Allow contents from metanorma.yml to be passed to hash_to_liquid(...).
To me, proposal B sounded simpler (initially), but metanorma.yml is not an input of Relaton, so the proposal reduces to proposal A.