-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnetlify.toml
More file actions
48 lines (39 loc) · 1.65 KB
/
netlify.toml
File metadata and controls
48 lines (39 loc) · 1.65 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
[build]
publish = "public"
command = "hugo --minify"
[build.environment]
HUGO_VERSION = "0.134.3"
HUGO_ENV = "production"
HUGO_ENABLEGITINFO = "true"
[context.production]
command = "hugo --minify"
[context.deploy-preview]
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"
[context.branch-deploy]
command = "hugo --buildFuture -b $DEPLOY_PRIME_URL"
[[headers]]
for = "/*"
[headers.values]
X-Frame-Options = "DENY"
X-XSS-Protection = "1; mode=block"
X-Content-Type-Options = "nosniff"
Referrer-Policy = "strict-origin-when-cross-origin"
Content-Security-Policy = "default-src 'self'; script-src 'self' 'unsafe-inline' 'unsafe-eval' *.google-analytics.com *.googletagmanager.com *.disqus.com *.disquscdn.com *.jsdelivr.net *.ibruce.info hm.baidu.com *.bdstatic.com *.qhres2.com cse.google.com *.google.com; style-src 'self' 'unsafe-inline' *.googleapis.com *.jsdelivr.net *.google.com; img-src 'self' data: *.google-analytics.com *.googletagmanager.com *.aliyuncs.com *.google.com *.googleusercontent.com clients1.google.com; font-src 'self' data: *.googleapis.com *.gstatic.com *.jsdelivr.net; connect-src 'self' *.google-analytics.com *.analytics.google.com *.googletagmanager.com *.google.com api.github.com;"
# 缓存静态资源
[[headers]]
for = "/css/*"
[headers.values]
Cache-Control = "public, max-age=31536000"
[[headers]]
for = "/js/*"
[headers.values]
Cache-Control = "public, max-age=31536000"
[[headers]]
for = "/images/*"
[headers.values]
Cache-Control = "public, max-age=31536000"
# 重定向规则(如果需要)
# [[redirects]]
# from = "/old-path/*"
# to = "/new-path/:splat"
# status = 301