I’ve got a Hugo documentation project and I would like to build two versions. An “offline” one that people can download and read on their machine, and a regular online one.
The difference between the two would be in the homepage layout and the header. The offline version has a little paragraph about it being the offline version and direct users to the latest version online. It would also say “offline” in the header. What is the best way to go about this?
To complicate things, this project already uses an environment to build only specific topics when that environment is used. Would the solution to the offline/online split be something similar?
Prior to v0.84.0 you could not inject HUGO_PARAMS_A_B=foo unless the [params.a] table was already defined in site configuration. Thanks for fixing this!
Thanks! That’s what I tried but it didn’t work and now I realised I have a very old version of Hugo installed (v0.67), so that’s probably why. I’ll upgrade and see if it works!
So. I upgraded to v0.90 and I still get “‘HUGO_PARAMS_FOO’ is not recognized as an internal or external command, operable program or batch file.” Not sure what I’m missing
Ah, thank you. Sorry, I’m not very technical. So here’s the bit in my partial:
{{ if eq “yes” site.Params.offline }}
This documentation is provided offline, so you can access it locally. Any updates made to the documentation since this release are available online.
{{ end }}
And then I build with:
set HUGO_PARAMS_OFFLINE=yes && hugo
But the paragraph doesn’t get added. However, if I actually add a parameter within my config file and just build as normal, that works. So my partial seems to be fine.