From ba115c4276f8e3e65d84ce0acb01028e487fc1fe Mon Sep 17 00:00:00 2001 From: Toshaan Bharvani Date: Mon, 11 Nov 2024 15:01:28 +0100 Subject: [PATCH] update hugo build options Signed-off-by: Toshaan Bharvani --- Makefile | 4 +++- config/_default/config.toml | 22 +++++++++++++++------- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/Makefile b/Makefile index 8ed434b..993fad5 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,8 @@ #!Makefile HUGO=hugo-extended +HUGO_NUMWORKERMULTIPLIER=64 +HUGO_MEMORYLIMIT=32 BUILDNAME:=$(shell git rev-parse --abbrev-ref HEAD) BASEURL:=$(shell basename `pwd` | sed 's/_/./g') BRANCHES:=$(shell git branch -r | sed 's/origin\///g' | sed 's/pr\//pr-/' | sed '/HEAD/d' | sed '/master/d' | sed '/main/d') @@ -28,7 +30,7 @@ build-staging: .PHONY: test test: clean - $(HUGO) --environment=development --minify --templateMetrics --templateMetricsHints --memstats hug_mem_log + HUGO_NUMWORKERMULTIPLIER=$(HUGO_NUMWORKERMULTIPLIER) HUGO_MEMORYLIMIT=$(HUGO_MEMORYLIMIT) $(HUGO) --environment=development --minify --printMemoryUsage --printPathWarnings --printUnusedTemplates --templateMetrics --templateMetricsHints .PHONY: draft draft: diff --git a/config/_default/config.toml b/config/_default/config.toml index 35b2500..a3cc7dd 100644 --- a/config/_default/config.toml +++ b/config/_default/config.toml @@ -22,6 +22,14 @@ enableEmoji = true noJSConfigInAssets = false # useResourceCacheWhen = 'always' writeStats = true + [build.buildStats] + enable = true + disableClasses = false + disableIDs = false + disableTags = false + [[build.cacheBusters]] + source = '(postcss|tailwind)\.config\.js' + target = '(css|styles|scss|sass)' [outputs] home = [ "HTML" , "RSS" ] @@ -141,20 +149,20 @@ enableEmoji = true [caches] [caches.assets] dir = ':resourceDir/_gen' - maxAge = "5m" + maxAge = -1 [caches.getcsv] dir = ':cacheDir/:project' - maxAge = "5m" + maxAge = -1 [caches.getjson] - dir = ':cacheDir/:project' - maxAge = "5m" + dir = ':cacheDir/:project' + maxAge = -1 ttl = 300 [caches.getresource] dir = ':cacheDir/:project' - maxAge = "5m" + maxAge = -1 [caches.images] dir = ':resourceDir/_gen' - maxAge ="5m" + maxAge = -1 [caches.modules] dir = ':cacheDir/modules' - maxAge = "5m" + maxAge = -1