The base path for 'resource.Get'


many thanks to @bep and others for making new features in Hugo 0.43 that are so nice for processing Web resources.

I tried out {{ $styles := resources.Get "..." ... }} as in documentation and ‘’. It seems that resources.Get will look into paths starting with project_root/assets ? Can I change this value, i.e. the base path where resources.Get will look up?


Try assetDir in your project config file.
The doc is coming but in the mean time, the best resource so far is here as mentionned in the Hugo news release:

1 Like

resources.Get also looks in the assets directory of your theme (so themes/mytheme/assets/). That way you can keep your asset files together with the rest of the theme.

I don’t know of a way to have resources.Get look elsewhere.

It might not be possible, since I recall a GitHub discussion about naming where ‘assets’ was decided as the go-to name for resources. (Can’t find that issue at this time.)

1 Like

Currently no.

I had some plans on allowing more (/static, /content), but I got into all sorts of trouble with the live-reloading bit, so that had to go.


Thanks all for your quick and cordial replies. I was just trying to minify my existing CSSs using Hugo minify instead of using external workflows (e.g. gulp, webpack) – looking forward to get rid of these tools for just post-processing / minifying. Thus, I specified resources.Get "/css/...". So it seems the viable solution for now is to move the to-be-processed CSSs to assets folder.

1 Like

Just an added note: You can create a symbolic link from /assets … somewhere.

1 Like

Hi, thanks for the great job for pipes!

The assetDir = "static" is working fine and I’m able to get my resources from my static/css folder.
But it’s still looking for the default assets folder in the theme’s directory.

Any way to fix this?

Thank you

But in the soon to come next Hugo, you can configure custom “file mounts” (and we have greatly improved symlink support, too, if that is your cup of tea).


A note here: You can now very simply mount any folder into /assets and get to it with Get.

1 Like