From 4c4f43779c6de5adf1c61edd4e79aae233965393 Mon Sep 17 00:00:00 2001 From: Xin Date: Sun, 3 Nov 2024 16:53:18 +0000 Subject: [PATCH] build(ci): build doc site from latest release instead of main - bump hugo version in workflow - bump github actions deps versions - minor update to head.html to remove empty spaces --- .github/workflows/pages.yml | 15 ++++++++------- layouts/partials/head.html | 16 ++++++++-------- 2 files changed, 16 insertions(+), 15 deletions(-) diff --git a/.github/workflows/pages.yml b/.github/workflows/pages.yml index 12d5bdd7..4fcf007d 100644 --- a/.github/workflows/pages.yml +++ b/.github/workflows/pages.yml @@ -31,7 +31,7 @@ jobs: build: runs-on: ubuntu-latest env: - HUGO_VERSION: 0.131.0 + HUGO_VERSION: 0.136.5 steps: - name: Checkout uses: actions/checkout@v4 @@ -41,10 +41,10 @@ jobs: - name: Setup Go uses: actions/setup-go@v5 with: - go-version: '1.22' + go-version: '1.23' - name: Setup Pages id: pages - uses: actions/configure-pages@v4 + uses: actions/configure-pages@v5 - name: Setup Hugo run: | wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \ @@ -54,11 +54,12 @@ jobs: # For maximum backward compatibility with Hugo modules HUGO_ENVIRONMENT: production HUGO_ENV: production + # Use the latest release of the theme to build exampleSite run: | - hugo \ - --minify \ - --themesDir=../.. --source=exampleSite \ - --baseURL "${{ steps.pages.outputs.base_url }}/" + cd exampleSite && rm go.mod + hugo mod init github.com/imfing/hextra/exampleSite + hugo mod get -u github.com/imfing/hextra + hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/" - name: Upload artifact uses: actions/upload-pages-artifact@v3 with: diff --git a/layouts/partials/head.html b/layouts/partials/head.html index 5c27e860..6fced1b3 100644 --- a/layouts/partials/head.html +++ b/layouts/partials/head.html @@ -6,7 +6,7 @@ {{ else -}} {{ end -}} - {{ partialCached "favicons.html" . }} + {{ partialCached "favicons.html" . -}} {{- if .IsHome -}} {{ .Site.Title -}} @@ -17,17 +17,17 @@ - {{ with .Params.canonical }} + {{- with .Params.canonical -}} - {{ else }} + {{- else -}} - {{ end }} + {{- end -}} - {{ partial "opengraph.html" . }} - {{ template "_internal/schema.html" . -}} - {{ template "_internal/twitter_cards.html" . -}} + {{- partial "opengraph.html" . -}} + {{- template "_internal/schema.html" . -}} + {{- template "_internal/twitter_cards.html" . -}} - {{ partialCached "head-css.html" . }} + {{- partialCached "head-css.html" . -}}