Use hugo's docs
This commit is contained in:
parent
3c562cbbbf
commit
3a78fd5aac
1 changed files with 35 additions and 2 deletions
|
@ -1,8 +1,41 @@
|
||||||
# The Docker image that will be used to build your app
|
variables:
|
||||||
image: klakegg/hugo:ci
|
DART_SASS_VERSION: 1.69.5
|
||||||
|
HUGO_VERSION: 0.121.0
|
||||||
|
NODE_VERSION: 20.x
|
||||||
|
GIT_DEPTH: 0
|
||||||
|
GIT_STRATEGY: clone
|
||||||
|
GIT_SUBMODULE_STRATEGY: recursive
|
||||||
|
TZ: America/Los_Angeles
|
||||||
|
|
||||||
|
image:
|
||||||
|
name: golang:1.20.6-bookworm
|
||||||
|
|
||||||
pages:
|
pages:
|
||||||
script:
|
script:
|
||||||
|
# Install brotli
|
||||||
|
- apt-get update
|
||||||
|
- apt-get install -y brotli
|
||||||
|
# Install Dart Sass
|
||||||
|
- curl -LJO https://github.com/sass/dart-sass/releases/download/${DART_SASS_VERSION}/dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
|
||||||
|
- tar -xf dart-sass-${DART_SASS_VERSION}-linux-x64.tar.gz
|
||||||
|
- cp -r dart-sass/ /usr/local/bin
|
||||||
|
- rm -rf dart-sass*
|
||||||
|
- export PATH=/usr/local/bin/dart-sass:$PATH
|
||||||
|
# Install Hugo
|
||||||
|
- curl -LJO https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb
|
||||||
|
- apt-get install -y ./hugo_extended_${HUGO_VERSION}_linux-amd64.deb
|
||||||
|
- rm hugo_extended_${HUGO_VERSION}_linux-amd64.deb
|
||||||
|
# Install Node.js
|
||||||
|
- curl -fsSL https://deb.nodesource.com/setup_${NODE_VERSION} | bash -
|
||||||
|
- apt-get install -y nodejs
|
||||||
|
# Install Node.js dependencies
|
||||||
|
- "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
|
||||||
|
# Build
|
||||||
- hugo --gc --minify
|
- hugo --gc --minify
|
||||||
|
# Compress
|
||||||
|
- find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec gzip -f -k {} \;
|
||||||
|
- find public -type f -regex '.*\.\(css\|html\|js\|txt\|xml\)$' -exec brotli -f -k {} \;
|
||||||
|
|
||||||
artifacts:
|
artifacts:
|
||||||
paths:
|
paths:
|
||||||
# The folder that contains the files to be exposed at the Page URL
|
# The folder that contains the files to be exposed at the Page URL
|
||||||
|
|
Loading…
Add table
Reference in a new issue