Change location of resources directory

Is there a way to change the location of the resources directory? We had difficulty reproducing CI errors locally because of a gitignored resources directory.

You can set the resourceDir in your config file

Also, from Hugo 0.52, see:

What’s misleading about this is that the resourceDir and cacheDir options aren’t listed in the way other options are.

:cacheDir
This is the value of the cacheDir config option if set (can also be set via OS env variable HUGO_CACHEDIR )

:resourceDir
This is the value of the resourceDir config option.

As a reader I don’t find this reassuring and would then go looking for the corresponding options alongside the rest.

Instead of:

caches

See Configure File Caches

It would be better if it read:

cacheDir (“default_path”)

Sets the location …

For more information, see Configure File Caches

Same for resourceDir.

I could create a PR for this, but only if you agree with the sentiment first. I still have a doc PR sitting ignored without comment.

1 Like