This reminds me: About a year ago I wrote down [1] some ideas I had about a static site generator that defines its structures in JSON schema (or something alike). It then uses this type information to validate the correct usage in all templates and inputs, as well as to generate a UI for editing. I'm pretty sure this idea is still a few steps ahead of any product/OSS I've seen in this space. Sadly, I've only ever implemented a simple prototype.
So, if anyone wants to give that a go, I'd be happy to see this implemented!
[1]: https://pascalhertleif.de/artikel/silicon-zucchini/