Skip to content

Commit ddd04b7

Browse files
Add netlify.toml with build config (#11)
## Summary - Adds `netlify.toml` with Hugo build command, publish directory, and cache headers - Sets `base = "/"` so Netlify runs Hugo from the repo root (not `docs/`) - Fixes `warnidf` call in `layouts/_partials/event.ics` — replaced with `warnf` for compatibility with Hugo < 0.123 ## Test plan - [ ] Netlify deploy preview builds successfully - [ ] `public/` is used as the publish directory 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent dcca41b commit ddd04b7

4 files changed

Lines changed: 34 additions & 3 deletions

File tree

layouts/_partials/event.ics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{{- /* Override of component event.ics — uses .Site.Language.Lang instead of .Locale (requires Hugo 0.159+) */ -}}
2-
{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnidf "debug-partial-used" "Partial used: %s" templates.Current.Name }}{{ end -}}
2+
{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnf "Partial used: %s" templates.Current.Name }}{{ end -}}
33
{{- $timezone := partial "ical/get_timezone.ics" . -}}
44
{{- $lang := .Site.Language.Lang -}}
55
{{- $endDate := "" -}}

layouts/_partials/header.ics

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnidf "debug-partial-used" "Partial used: %s" templates.Current.Name }}{{ end -}}
1+
{{- if or (eq hugo.Environment "development") (eq hugo.Environment "debug") }}{{ warnf "Partial used: %s" templates.Current.Name }}{{ end -}}
22
{{/* Override of component header.ics — uses .Site.Language.Lang instead of .Locale (requires Hugo 0.159+) */}}
33
{{ with dict `` `
44
` "name" (dict "text" "PowerShell.org Community Calendar" "lang" .Site.Language.Lang) `` `

netlify.toml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[build]
2+
base = "/"
3+
command = "hugo --minify"
4+
publish = "public"
5+
6+
[build.environment]
7+
HUGO_VERSION = "0.155.1"
8+
HUGO_ENVIRONMENT = "production"
9+
TZ = "UTC"
10+
11+
[[headers]]
12+
for = "/*"
13+
[headers.values]
14+
X-Frame-Options = "DENY"
15+
X-Content-Type-Options = "nosniff"
16+
Referrer-Policy = "strict-origin-when-cross-origin"
17+
18+
[[headers]]
19+
for = "/discord/*"
20+
[headers.values]
21+
Cache-Control = "public, max-age=3600"
22+
23+
[[headers]]
24+
for = "/*.css"
25+
[headers.values]
26+
Cache-Control = "public, max-age=31536000, immutable"
27+
28+
[[headers]]
29+
for = "/*.js"
30+
[headers.values]
31+
Cache-Control = "public, max-age=31536000, immutable"

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"preview": "hugo server --environment production"
1010
},
1111
"devDependencies": {
12-
"hugo-extended": "^0.121.0",
12+
"hugo-extended": "^0.155.1",
1313
"node-fetch": "^3.3.2"
1414
}
1515
}

0 commit comments

Comments
 (0)