Closed existentialmutt closed 2 years ago
@existentialmutt It's an intriguing thought, but as the metadata file (and all YAML files) in src/_data
is processed through the same resource engine as all other content folders, might need a bit of consideration. In the meantime, I wonder if switching to a Ruby file/hash would do the trick for you? https://www.bridgetownrb.com/docs/datafiles#the-metadata-file
Sure, writing a ruby file directly should take care of what I need to do. Thanks Jared!
Cool, I think for the time being we can close this.
Summary
Allow ERB tags in configuration YAML files.
Motivation
Embedding ERB in configuration YAML is a handy feature many Rails devs are familiar with. This allows individual developers to customize their configuration with ENV vars while also embedding sane defaults in the config. For instance, it would be really slick to be able to have this in my site.metadata.yml
Guide-level explanation
site.metadata.yml
may include ERB tags. For instance:Reference-level explanation
Run configuration through an ERB processor before loading the YAML file.
Drawbacks
Slight impact on build performance?
Unresolved Questions