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.:
---
title: Snippets
custom1: Hello
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’
{{#if postViewConfig.post.title}}
<h1>{{postViewConfig.post.title}}</h1>
{{/if}}
{{#if postViewConfig.post.custom1}}
<h3>{{postViewConfig.post.custom1}}</h3>
{{/if}}
{{#if postViewConfig.post.custom2}}
{{postViewConfig.post.custom2}}
{{/if}}
etc … results in this:
<h1>Snippets</h1>
<h3>Hello</h3>
<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)