Skip to content

Commit d4987bd

Browse files
committed
feat: add netlify.toml for PR deploy previews
1 parent 034dd1d commit d4987bd

1 file changed

Lines changed: 47 additions & 0 deletions

File tree

netlify.toml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
[build]
2+
publishDir = "public"
3+
4+
[build.environment]
5+
HUGO_VERSION = "0.123.0"
6+
NODE_VERSION = "20"
7+
8+
[[redirects]]
9+
from = "/docs/*"
10+
to = "/documentation/:splat"
11+
status = 301
12+
13+
[[redirects]]
14+
from = "/blog/*"
15+
to = "/blog/:splat"
16+
status = 301
17+
18+
[[headers]]
19+
for = "/*"
20+
[headers.values]
21+
X-Frame-Options = "DENY"
22+
X-Content-Type-Options = "nosniff"
23+
Referrer-Policy = "strict-origin-when-cross-origin"
24+
25+
[[headers]]
26+
for = "*.js"
27+
[headers.values]
28+
Cache-Control = "public, max-age=31536000"
29+
30+
[[headers]]
31+
for = "*.css"
32+
[headers.values]
33+
Cache-Control = "public, max-age=31536000"
34+
35+
[[headers]]
36+
for = "*.png"
37+
[headers.values]
38+
Cache-Control = "public, max-age=2592000"
39+
40+
[context.production.environment]
41+
HUGO_ENV = "production"
42+
43+
[context.deploy-preview.environment]
44+
HUGO_ENV = "preview"
45+
46+
[context.branch-deploy.environment]
47+
HUGO_ENV = "staging"

0 commit comments

Comments
 (0)