|
1 | 1 | [build]
|
2 |
| - # Specify the directory containing the output of Hugo |
3 |
| - publish = "public" |
4 |
| - # Hugo build command |
5 |
| - command = "hugo --gc --minify" |
6 |
| - |
7 |
| -[context.production] |
8 |
| - # Specify the Hugo version |
| 2 | + # Set the Hugo version |
9 | 3 | HUGO_VERSION = "0.139.2"
|
| 4 | + |
| 5 | + # Build command |
| 6 | + command = """ |
| 7 | + wget -O hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb && |
| 8 | + sudo dpkg -i hugo.deb && |
| 9 | + sudo snap install dart-sass && |
| 10 | + npm install -D postcss postcss-cli autoprefixer hugo-extended && |
| 11 | + hugo --gc --minify |
| 12 | + """ |
| 13 | + |
| 14 | + # Publish directory |
| 15 | + publish = "public" |
10 | 16 |
|
11 |
| - # Install additional dependencies before building |
12 |
| - [context.production.environment] |
13 |
| - NODE_VERSION = "lts/*" |
14 |
| - GO_VERSION = "stable" |
15 |
| - |
16 |
| - [context.production.command] |
17 |
| - # Custom pre-build steps |
18 |
| - [[context.production.command.pre]] |
19 |
| - command = "npm install -D postcss postcss-cli autoprefixer hugo-extended" |
20 |
| - |
21 |
| -[[plugins]] |
22 |
| - # Install Dart Sass plugin if needed |
23 |
| - package = "@netlify/plugin-functions-core" |
| 17 | +# Set environment variables |
| 18 | +[context.production.environment] |
| 19 | + HUGO_ENVIRONMENT = "production" |
| 20 | + HUGO_ENV = "production" |
24 | 21 |
|
25 |
| -[[plugins.inputs]] |
26 |
| - command = "sudo snap install dart-sass" |
| 22 | +# Node.js version configuration |
| 23 | +[build.environment] |
| 24 | + NODE_VERSION = "lts/*" |
27 | 25 |
|
28 |
| -[build.processing] |
29 |
| - # Ensure clean builds |
30 |
| - skip_processing = false |
| 26 | +# Optional: Add headers for security and performance |
| 27 | +[[headers]] |
| 28 | + for = "/*" |
| 29 | + [headers.values] |
| 30 | + X-Frame-Options = "DENY" |
| 31 | + X-XSS-Protection = "1; mode=block" |
31 | 32 |
|
32 |
| -# [context.branch-deploy] |
33 |
| -# # Customize branch deploy logic if necessary |
34 |
| -# command = "hugo --gc --minify --buildDrafts" |
| 33 | +# Optional: Redirects (if needed) |
| 34 | +# [[redirects]] |
| 35 | +# from = "/*" |
| 36 | +# to = "/index.html" |
| 37 | +# status = 200 |
0 commit comments