I am currently working/playing on a website about my HUGO learning.
Essentially, the website documented my learning and will also serve as a future guide.
I would like to document the frontmatter keys used and what they mean.
I use different frontmatter on different pages.
Is there a way to read all keys of all frontmatters of all (content-)files?
your code gives me the information I am looking for.
Reading your code I get an idea what could be meant by the explanations about “dict” and “merge” in the documentation… Special thanks for your explanatory words about the not explicitly set frontmatters.
My ideal:
The shortcode writes the “keys” to a file.
In this file I document the task of each “key” (frontmatters).
Is it possible to keep this file up to date using shortcode?
In particular, is it possible to add new “keys” without changing the existing “keys” and their explanations?
Hugo can only create files in the publishDir (typically public).
I suppose you could combine the parsing code with a data file for the key descriptions, but I think the cost of trying to automate this far exceeds the value delivered. Remember that .Page.Params can contain scalars, objects, arrays, and nested combinations – the structure is not trivial.
If it were me, I would maintain the documentation manually.
When you say “the structure is not trivial” then it is beyond my capabilities.
And when you say you “would maintain the documentation manually” then I definitely do.
And there are so many other adventures to experience, e.g. I learn a lot about “dict” and “merge” thanks to your code example. Also I want to finally understand this taxonomy thing.