mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-17 21:01:26 +02:00
Merge commit 'b3d87dd0fd746f07f9afa6e6a2969aea41da6a38'
This commit is contained in:
@@ -136,6 +136,8 @@ jobs:
|
||||
key: hugo-${{ github.run_id }}
|
||||
restore-keys:
|
||||
hugo-
|
||||
- name: Configure Git
|
||||
run: git config core.quotepath false
|
||||
- name: Build with Hugo
|
||||
run: |
|
||||
hugo \
|
||||
|
@@ -23,15 +23,15 @@ Define your [CI/CD](g) jobs by creating a `.gitlab-ci.yml` file in the root of y
|
||||
|
||||
```yaml {file=".gitlab-ci.yml" copy=true}
|
||||
variables:
|
||||
DART_SASS_VERSION: 1.85.0
|
||||
DART_SASS_VERSION: 1.87.0
|
||||
GIT_DEPTH: 0
|
||||
GIT_STRATEGY: clone
|
||||
GIT_SUBMODULE_STRATEGY: recursive
|
||||
HUGO_VERSION: 0.144.2
|
||||
NODE_VERSION: 23.x
|
||||
HUGO_VERSION: 0.146.7
|
||||
NODE_VERSION: 22.x
|
||||
TZ: America/Los_Angeles
|
||||
image:
|
||||
name: golang:1.23.4-bookworm
|
||||
name: golang:1.24.2-bookworm
|
||||
|
||||
pages:
|
||||
script:
|
||||
@@ -53,6 +53,8 @@ pages:
|
||||
- apt-get install -y nodejs
|
||||
# Install Node.js dependencies
|
||||
- "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
|
||||
# Configure Git
|
||||
- git config core.quotepath false
|
||||
# Build
|
||||
- hugo --gc --minify --baseURL ${CI_PAGES_URL}
|
||||
# Compress
|
||||
|
@@ -113,21 +113,23 @@ Create a new file named netlify.toml in the root of your project directory. In i
|
||||
|
||||
```toml {file="netlify.toml"}
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.144.2"
|
||||
GO_VERSION = "1.24"
|
||||
HUGO_VERSION = "0.146.7"
|
||||
NODE_VERSION = "22"
|
||||
TZ = "America/Los_Angeles"
|
||||
|
||||
[build]
|
||||
publish = "public"
|
||||
command = "hugo --gc --minify"
|
||||
command = "git config core.quotepath false && hugo --gc --minify"
|
||||
```
|
||||
|
||||
If your site requires Dart Sass to transpile Sass to CSS, the configuration file should look something like this:
|
||||
|
||||
```toml {file="netlify.toml"}
|
||||
[build.environment]
|
||||
HUGO_VERSION = "0.144.2"
|
||||
DART_SASS_VERSION = "1.85.0"
|
||||
DART_SASS_VERSION = "1.87.0"
|
||||
GO_VERSION = "1.24"
|
||||
HUGO_VERSION = "0.146.7"
|
||||
NODE_VERSION = "22"
|
||||
TZ = "America/Los_Angeles"
|
||||
|
||||
@@ -138,6 +140,7 @@ command = """\
|
||||
tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
|
||||
rm dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz && \
|
||||
export PATH=/opt/build/repo/dart-sass:$PATH && \
|
||||
git config core.quotepath false && \
|
||||
hugo --gc --minify \
|
||||
"""
|
||||
```
|
||||
|
Reference in New Issue
Block a user