Create multiple website from different data templates

My Goal:

I want to create the same website multiple times but with different values for specific strings.
Kind of white label documentation for a product with different features or limits for those features.

I found the data-templates which I could use with the shortcodes to add data from json|yaml.
There are also remote data endpoints with URLs. That worked so far for testing.

Is it possible to add a data file during the build process of the Hugo website?
I did not find such a command line flag but could have missed something.
I would like to use a different yaml for each whitelabel website.
If not is there a better way?

Set a value via an environment variable on the command line.

├── a.json
└── b.json


{{ index site.Data site.Params.x "foo" }}

command line

HUGO_PARAMS_x=a hugo   # data will be pulled from data/a.json
HUGO_PARAMS_x=b hugo   # data will be pulled from data/b.json
1 Like

Why does your call to index have a third parameter?

I am accessing a “foo” object in the data file.

1 Like

This is a good idea!
Will try that.