The-Balance-FFXIV / glam

A hugo theme for the balance
Other
5 stars 24 forks source link

generate yaml configuration #306

Open nonowazu opened 2 years ago

nonowazu commented 2 years ago

I'm not sure if this ends up being a hugo generation item or a scripting language with a config file, but I'm pretty sure that:

  1. the current one is horrifying to edit (at 6.8k lines long
  2. It means changes like #299 require us to keep two of the same file around, (yes, I realize only ~10 lines differ between them, but it's still something to keep in sync
  3. The current method is error prone (typo in a field can break pages, for example)

I'd like to propose (perhaps) adding a python script that would take in a configuration file (json/yaml/toml – I don't care) and generate the .yml file on demand. This could be run on a developer machine to generate a functional configuration for dev yaml, and production workflow(s) could generate it as part of the "generate the website" steps. The reasons I suggest python are:

  1. It's widely available in a github action
  2. If we choose .ini or .json (and .toml as of python 3.11) for the config file, it's all standard library all the way down
  3. Doesn't require any compilation/extra steps to make work (other than installing python on a dev machine I guess?)
  4. Could be dockerized (weird to create a container just for generating a configuration file, but what a world I suggest we live in)
  5. I like python