fix(docs): fix sponsor link baseURL and add git commit hash to footer

- Use relURL (no leading slash) for the sponsor link so it respects
  the /Bose-SoundTouch/ base path on GitHub Pages; absURL and relURL
  both ignore the base path when the input starts with /
- Inject HUGO_PARAMS_GITHASH (github.sha) via the docs workflow and
  forward it into the Hugo container via docker-compose.docs.yml +
  make dev-docs, so the deployed footer shows a clickable short hash
  linking to the exact commit
- Use site.Params.githash (global) instead of .Site.Params.githash
  because Hextra calls custom/footer.html with a dict context, not a
  page; .Site is nil in that scope
- Use substr not slice to trim the hash to 7 chars

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Tobias Gesellchen
2026-05-25 00:37:30 +02:00
co-authored by Claude Sonnet 4.6
parent 70dea42c10
commit d71a5c3bed
4 changed files with 8 additions and 2 deletions
+1
View File
@@ -33,6 +33,7 @@ jobs:
run: hugo --source docs/ --minify --destination ../_site --baseURL "${{ steps.pages.outputs.base_url }}"
env:
HUGO_ENVIRONMENT: production
HUGO_PARAMS_GITHASH: ${{ github.sha }}
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
+1 -1
View File
@@ -458,7 +458,7 @@ screenshots:
# First run: make dev-docs-tidy (downloads Hextra, writes docs/go.sum)
# Then: make dev-docs (http://localhost:1313, live reload)
dev-docs:
docker compose -f docker-compose.docs.yml up
HUGO_PARAMS_GITHASH=$(shell git rev-parse HEAD) docker compose -f docker-compose.docs.yml up
dev-docs-tidy:
docker compose -f docker-compose.docs.yml run --rm hugo mod tidy --source docs/
+2
View File
@@ -27,6 +27,8 @@ services:
# downloads Hextra once.
- hugo-mod-cache:/root/.cache/hugo_cache
working_dir: /src
environment:
- HUGO_PARAMS_GITHASH
volumes:
hugo-mod-cache:
+4 -1
View File
@@ -1,6 +1,6 @@
<div class="hx:flex hx:w-full hx:items-center hx:justify-between hx:text-sm" style="padding-top: 2rem; padding-bottom: 2rem;">
<a class="hx:inline-flex hx:items-center hx:gap-1.5 hx:text-gray-500 hx:dark:text-gray-400 hx:hover:text-pink-500 hx:dark:hover:text-pink-400 hx:transition-colors"
href="{{ "/sponsor" | absURL }}"
href="{{ "sponsor" | relURL }}"
target="_blank"
rel="noopener noreferrer">
<span style="color: #ec4899;">
@@ -10,5 +10,8 @@
</a>
<span class="hx:text-xs hx:text-gray-500 hx:dark:text-gray-400">
© 2026 <a class="hx:hover:underline" href="https://github.com/gesellix" target="_blank" rel="noopener noreferrer">Tobias Gesellchen</a>
{{- with site.Params.githash }}
· <a class="hx:font-mono hx:hover:underline" href="https://github.com/gesellix/Bose-SoundTouch/commit/{{ . }}" target="_blank" rel="noopener noreferrer" title="Built from commit {{ . }}">{{ substr . 0 7 }}</a>
{{- end }}
</span>
</div>