From a1cb98c1296cdca80dda73a56a169a3738cefc53 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B8rn=20Erik=20Pedersen?= Date: Wed, 14 Nov 2018 17:18:32 +0100 Subject: [PATCH] cache/filecache: Add a :project placeholder This allows for "cache per Hugo project", making `hugo --gc` work as expected, even if you have several Hugo projects running on the same PC. See #5439 --- content/en/getting-started/configuration.md | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/content/en/getting-started/configuration.md b/content/en/getting-started/configuration.md index cb2eed4cd..f67b9370b 100644 --- a/content/en/getting-started/configuration.md +++ b/content/en/getting-started/configuration.md @@ -413,10 +413,10 @@ Since Hugo 0.52 you can configure more than just the `cacheDir`. This is the def ```toml [caches] [caches.getjson] -dir = ":cacheDir" +dir = ":cacheDir/:project" maxAge = -1 [caches.getcsv] -dir = ":cacheDir" +dir = ":cacheDir/:project" maxAge = -1 [caches.images] dir = ":resourceDir/_gen" @@ -434,6 +434,9 @@ You can override any of these cache setting in your own `config.toml`. :cacheDir : This is the value of the `cacheDir` config option if set (can also be set via OS env variable `HUGO_CACHEDIR`). It will fall back to `/opt/build/cache/hugo_cache/` on Netlify, or a `hugo_cache` directory below the OS temp dir for the others. This means that if you run your builds on Netlify, all caches configured with `:cacheDir` will be saved and restored on the next build. For other CI vendors, please read their documentation. For an CircleCI example, see [this configuration](https://github.com/bep/hugo-sass-test/blob/6c3960a8f4b90e8938228688bc49bdcdd6b2d99e/.circleci/config.yml). +:project + +The base directory name of the current Hugo project. This means that, in its default setting, every project will have separated file caches, which means that when you do `hugo --gc` you will not touch files related to other Hugo projects running on the same PC. :resourceDir : This is the value of the `resourceDir` config option.