Skip to content

Commit

Permalink
build(ci): build doc site from latest release instead of main
Browse files Browse the repository at this point in the history
- bump hugo version in workflow
- bump github actions deps versions
- minor update to head.html to remove empty spaces
  • Loading branch information
imfing committed Nov 3, 2024
1 parent ff85e69 commit 4c4f437
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 15 deletions.
15 changes: 8 additions & 7 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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 \
Expand All @@ -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:
Expand Down
16 changes: 8 additions & 8 deletions layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
{{ else -}}
<meta name="robots" content="noindex, nofollow" />
{{ end -}}
{{ partialCached "favicons.html" . }}
{{ partialCached "favicons.html" . -}}
<title>
{{- if .IsHome -}}
{{ .Site.Title -}}
Expand All @@ -17,17 +17,17 @@
</title>
<meta name="description" content="{{ partial "utils/page-description.html" . }}" />

{{ with .Params.canonical }}
{{- with .Params.canonical -}}
<link rel="canonical" href="{{ . }}" itemprop="url" />
{{ else }}
{{- else -}}
<link rel="canonical" href="{{ .Permalink }}" itemprop="url" />
{{ 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" . -}}


<!-- Google Analytics -->
Expand Down

0 comments on commit 4c4f437

Please sign in to comment.