hugo icon indicating copy to clipboard operation
hugo copied to clipboard

Add a JSON config schema

Open bep opened this issue 1 year ago • 4 comments

The ones I find in VS Code are incredibly outdated:

image

bep avatar May 22 '23 13:05 bep

And just as a wish list item: support for JSONC, or some other comments-friendly format that’s otherwise suitable for config purposes, would be nice. (A fellow can dream. 😄)

brycewray avatar May 27 '23 10:05 brycewray

Hosting the schema in the hugo repo will open the door to generating it as part of the build/release process. I believe you'd be able to reflect over the config classes to generate the schema without too much fuss. A quick and dirty approach can avoid dealing validation. A nicer version that includes validation would need to be able to annotate a few extra properties on the config classes like regex patterns, allowed enum values, whether unrecognized properties are allowed, etc.

Also note that a single schema can support all three site config languages.

akbyrd avatar Dec 12 '23 10:12 akbyrd