Parse frontmatter from Latte file
- Crell
- Member | 3
I am doing something admittedly a bit oddball with Latte, but I think it's going to work. :-) Specifically, it's common for Markdown files to have some kind of YAML “frontmatter” on them, like so:
---
title: Foo
tags: [a, b, c]
---
Markdown text here.
I want to do something similar for Latte files. Some way to define additional semi-free-form values that can be extracted from the template into an array or similar, which can then be used for processing. It doesn't have to be a YAML block, though something compact would be preferred. I assume I would need to compile the template first and then pull data from it, which is fine.
Anyone tried doing this? Any suggestions on how I'd go about doing it? Existing tools that may help, or hints on how to write my own tool? Many thanks.
Last edited by Crell (2024-08-31 20:56)