From 25180022b15455a36863c625e1ed0bdb3dea991e Mon Sep 17 00:00:00 2001 From: Tim Bannister Date: Sat, 10 Oct 2020 17:58:38 +0100 Subject: [PATCH] Update local Hugo development target - mount /tmp as tmpfs - configure Hugo to use /tmp for all caches - configure Hugo to render into /tmp --- Makefile | 4 ++-- config.toml | 17 +++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 523775cd17..e8576459a4 100644 --- a/Makefile +++ b/Makefile @@ -65,10 +65,10 @@ container-image: --build-arg HUGO_VERSION=$(HUGO_VERSION) container-build: module-check - $(CONTAINER_RUN) $(CONTAINER_IMAGE) hugo --minify + $(CONTAINER_RUN) --read-only $(CONTAINER_IMAGE) hugo --minify container-serve: module-check - $(CONTAINER_RUN) --mount type=tmpfs,destination=/src/resources,tmpfs-mode=0777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 + $(CONTAINER_RUN) --read-only --mount type=tmpfs,destination=/tmp,tmpfs-mode=01777 -p 1313:1313 $(CONTAINER_IMAGE) hugo server --buildFuture --bind 0.0.0.0 --destination /tmp/hugo --cleanDestinationDir test-examples: scripts/test_examples.sh install diff --git a/config.toml b/config.toml index c3ecb630f7..0618d6a75d 100644 --- a/config.toml +++ b/config.toml @@ -33,6 +33,23 @@ enableGitInfo = true # Hindi is disabled because it's currently in development. disableLanguages = ["hi", "no"] +[caches] + [caches.assets] + dir = ":cacheDir/_gen" + maxAge = -1 + [caches.getcsv] + dir = ":cacheDir/:project" + maxAge = "60s" + [caches.getjson] + dir = ":cacheDir/:project" + maxAge = "60s" + [caches.images] + dir = ":cacheDir/_images" + maxAge = -1 + [caches.modules] + dir = ":cacheDir/modules" + maxAge = -1 + [markup] [markup.goldmark] [markup.goldmark.extensions]