From a256bae8a623d0bc7e6ead77b683604e832e23d5 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 18:37:14 -0700 Subject: [PATCH 1/8] Add netlify.toml with build config and cache headers Co-Authored-By: Claude Sonnet 4.6 --- netlify.toml | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) create mode 100644 netlify.toml diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 000000000..d13b0adde --- /dev/null +++ b/netlify.toml @@ -0,0 +1,30 @@ +[build] + command = "hugo --minify" + publish = "public" + +[build.environment] + HUGO_VERSION = "0.155.1" + HUGO_ENVIRONMENT = "production" + TZ = "UTC" + +[[headers]] + for = "/*" + [headers.values] + X-Frame-Options = "DENY" + X-Content-Type-Options = "nosniff" + Referrer-Policy = "strict-origin-when-cross-origin" + +[[headers]] + for = "/discord/*" + [headers.values] + Cache-Control = "public, max-age=3600" + +[[headers]] + for = "/*.css" + [headers.values] + Cache-Control = "public, max-age=31536000, immutable" + +[[headers]] + for = "/*.js" + [headers.values] + Cache-Control = "public, max-age=31536000, immutable" From 62900bb4cdba8a839a4ec29d240ed298816e3a1f Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 18:38:29 -0700 Subject: [PATCH 2/8] Fix Netlify base directory to repo root Co-Authored-By: Claude Sonnet 4.6 --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index d13b0adde..4a7b0f073 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,4 +1,5 @@ [build] + base = "/" command = "hugo --minify" publish = "public" From cb46068345b2cbc6247c9098e93a41823d9829cc Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 18:40:42 -0700 Subject: [PATCH 3/8] Fix warnidf compatibility with Hugo < 0.123 Co-Authored-By: Claude Sonnet 4.6 --- layouts/_partials/event.ics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_partials/event.ics b/layouts/_partials/event.ics index 206bd8b17..a99dad901 100644 --- a/layouts/_partials/event.ics +++ b/layouts/_partials/event.ics @@ -1,5 +1,5 @@ {{- /* Override of component event.ics — uses .Site.Language.Lang instead of .Locale (requires Hugo 0.159+) */ -}} -{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnidf "debug-partial-used" "Partial used: %s" templates.Current.Name }}{{ end -}} +{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnf "Partial used: %s" templates.Current.Name }}{{ end -}} {{- $timezone := partial "ical/get_timezone.ics" . -}} {{- $lang := .Site.Language.Lang -}} {{- $endDate := "" -}} From f8def474b2252ac0500c6a9281627baf121d0a7b Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 19:32:39 -0700 Subject: [PATCH 4/8] Fix warnidf in header.ics for Hugo < 0.123 compatibility Co-Authored-By: Claude Sonnet 4.6 --- layouts/_partials/header.ics | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/_partials/header.ics b/layouts/_partials/header.ics index 9af200765..020a23b64 100644 --- a/layouts/_partials/header.ics +++ b/layouts/_partials/header.ics @@ -1,4 +1,4 @@ -{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnidf "debug-partial-used" "Partial used: %s" templates.Current.Name }}{{ end -}} +{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnf "Partial used: %s" templates.Current.Name }}{{ end -}} {{/* Override of component header.ics — uses .Site.Language.Lang instead of .Locale (requires Hugo 0.159+) */}} {{ with dict `` ` ` "name" (dict "text" "PowerShell.org Community Calendar" "lang" .Site.Language.Lang) `` ` From 9a63462369500b507615bf231930100fdda69ad5 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 19:45:11 -0700 Subject: [PATCH 5/8] Remove base = "/" from netlify.toml base = "/" resolves to the filesystem root, not the repo root. Omitting base entirely is the correct way to build from the repo root. Co-Authored-By: Claude Opus 4.7 --- netlify.toml | 1 - 1 file changed, 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index 4a7b0f073..d13b0adde 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,4 @@ [build] - base = "/" command = "hugo --minify" publish = "public" From 2ea231cd761bd1ea78db30188a4b514b1fe6fea8 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 19:46:39 -0700 Subject: [PATCH 6/8] Manually install Hugo in build command Netlify's HUGO_VERSION env var is being silently ignored on the Noble build image (still running bundled 0.121.2 despite HUGO_VERSION=0.155.1). The third-party hugo-theme-component-ical module uses warnidf which requires Hugo >= 0.123, so we need a controlled install. Mirrors the wget + dpkg approach used in .github/workflows/deploy.yml. Co-Authored-By: Claude Opus 4.7 --- netlify.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/netlify.toml b/netlify.toml index d13b0adde..958c0ad31 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ [build] - command = "hugo --minify" + command = "wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb && sudo dpkg -i /tmp/hugo.deb && hugo --minify" publish = "public" [build.environment] From fb85105b6fc1b8af354a9c8cf1fbf575d5150274 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 19:49:13 -0700 Subject: [PATCH 7/8] Bump hugo-extended to ^0.155.1 (fixes warnidf compatibility) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The npm hugo-extended devDependency was pinned at ^0.121.0, so Netlify's auto npm install was putting Hugo 0.121.x on the PATH ahead of any HUGO_VERSION-resolved binary. That's why HUGO_VERSION appeared to be ignored — it wasn't, the npm-installed Hugo just took precedence. Bumping to ^0.155.1 brings npm-installed Hugo above the 0.123 cutoff where warnidf landed, so the hugo-theme-component-ical module builds. Also reverts the wget+dpkg workaround from netlify.toml — no longer needed now that the npm-installed Hugo is current. Co-Authored-By: Claude Opus 4.7 --- netlify.toml | 2 +- package.json | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/netlify.toml b/netlify.toml index 958c0ad31..d13b0adde 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,5 +1,5 @@ [build] - command = "wget -O /tmp/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb && sudo dpkg -i /tmp/hugo.deb && hugo --minify" + command = "hugo --minify" publish = "public" [build.environment] diff --git a/package.json b/package.json index 279e5d1a1..be6016c1a 100644 --- a/package.json +++ b/package.json @@ -9,7 +9,7 @@ "preview": "hugo server --environment production" }, "devDependencies": { - "hugo-extended": "^0.121.0", + "hugo-extended": "^0.155.1", "node-fetch": "^3.3.2" } } \ No newline at end of file From 5d5f158d83a4b3c9b9c14613ca26726ef1c4f311 Mon Sep 17 00:00:00 2001 From: Gilbert Sanchez Date: Tue, 26 May 2026 19:50:50 -0700 Subject: [PATCH 8/8] Restore base = "/" in netlify.toml Match the live Netlify site configuration. Co-Authored-By: Claude Opus 4.7 --- netlify.toml | 1 + 1 file changed, 1 insertion(+) diff --git a/netlify.toml b/netlify.toml index d13b0adde..4a7b0f073 100644 --- a/netlify.toml +++ b/netlify.toml @@ -1,4 +1,5 @@ [build] + base = "/" command = "hugo --minify" publish = "public"