kobweb
kobweb copied to clipboard
Add a way to reference variables declared inside markdown front matter
Something like:
---
author: bitspittle
---
This blog post was brought to you by {{ author }}
We'll need to think about this. This will really only work well if we think of this as a larger feature, e.g. you can specify a yaml config elsewhere with all variables and then reference them in a {{ }} block, like above maybe author is set to nobody by default unless specifically tagged in the front matter.
Then the question is, will we be able to reference those variables in the normal kt files as well???
Note that we're currently using {{ }} for calling Composable code. Maybe we can use the same block for front matter stuff too? {{ $author }} for example. Or maybe $author? Or $$author$$?
Since we can access front matter in code, it's not critical for this to get into 1.0 anymore. (If anyone has a use case that's critical, though, that I'm overlooking, please share it here)