Hi,
I ran into a problem where I can see no obvious solution.
Situation:
- I have set up Hugo for GitHub pages.
- I use two Hugo environments (development and production) with different config files.
- I generate the development data into
docs
and publish it to GitHub to be served astest.myblog.com
. - I generate the production data into
../public
, which is a different repo. I push this repo to GitHub to be served undermyblog.com
.
Problem:
The CNAME file that GitHub requires must contain the custom domain, but this domain can have two different values. Yet, when I put the CNAME file into the static
folder it obviously is the same file in both Hugo environments.
Question:
How can I generate the CNAME contents from the baseURL
setting in the active config file?
That is, for hugo -e development
, CNAME should contain the base URL from the development config file, that is, test.myblog.com
, and when running hugo -e production
, CNAME should contain myblog.com
from the production config file.
Templates seem to be restricted to particular output types, e.g. .html or .xml files, hence no option here if I am not wrong.
Or did I overlook something obvoius?