Custom Cache Directory for `hugo server` ( not /resources )

tldr; is it possible to define the resources cache dir name to make it not /resources?

is there any way to modify the name of /resources/ folder when doing hugo server?

I have searched the forum and docs, and I think I cannot found similar topic. I tried --cacheDir but it turns out not the specified cache.

My point of asking this is, I write my blog in 3 of my iCloud connected devices, and using git to keep all the articles in sync proven cumbersome. I do the stupid move to move my hugo project folder to /Users/<uname>/Documents/hugo_project/ to keep it synced. However, if I do hugo server, a cache folder named resources will be created, and I don’t want iCloud continuously sync it.

iCloud has no .gitignore concept, but it will not sync folders or files with specific rules. One of the rule is if the folder contains .nosync in the name.


Is it possible? Thanks, Hugo is an awesome project! I hope the best for the Hugo team :smiley:

Its here Configure File Caches.

[caches.images]
dir = "/Users/<uname>/Documents/hugo_project/.nosync/_gen"
maxAge = -1

[caches.assets]
dir = "/Users/<uname>/Documents/hugo_project/.nosync/_gen"
maxAge = -1

the target dir must be absolute path.

1 Like

This is super useful!

I missed that part in the documentation, thank you very much!

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.