Forum › General Inquiry
summary: snippets to remember
thanks for the reply. It could be, we are talking about 2 different things 😉
I want the postOptions to be created dynamically from the YAML (front-matter) keys, which are entered as raw text inside a post.
When reading a post, the application looks for the front-matter and – if found – uses those front-matter-variables as postOptions. E.g.:
custom2: This is a test
And then strips front-matter-variables from the output.
Then – in the template – I just can use those variables as regular ‘postOptions’
etc … results in this:
<p>This is a test</p>
(front-matter always wins over built-in postOptions…)
I hope this makes it a bit more obvious, what I’m trying to do.
This makes it incredible powerful to create/use NoSQL-like content, and makes it also pretty easy to ‘tune’ the output by just adjusting some templates/partials….
Does that make my intent clearer?
(Btw: if there was a plugin API, this would also make a nifty plugin, imo)
I’ve seen that… it’s close, but unfortunately that doesn’t work for me. I want to keep front-matter with the markdown.
I would like to have Publii take the value of the front-matter-variable and use it as value.
"label": "insert custom1 value",
"value": "use front-matter-variable 'custom1'",
"label": "insert custom2 value",
"value": "use front-matter-variable 'custom2'",
And – of course – then strip the front-matter alltogether before saving to HTML.
If there will be a plugin API available at some point to process post-data I’ll re-visit this.
Please feel free to drop me a note, if you are working on something and need some input.
And thanks again for your input…
btw. normally I code those things by hand and export via a shell, but Publii looks interesting and I really like what you did so far 🙂
Anyway… thanks for your input!! 😉
So, if someone from the team reads this – feel free to join the discussion 🙂