Fix Hugo build: nav.html used invalid hugo.Data syntax, fix deploy.sh path

nav.html: hugo.Data.nav.items → .Site.Data.nav.items (hugo.Data is not
a valid accessor for data files in any Hugo version).

deploy.sh: run hugo from site/ subdir, output to public/ at repo root
where nginx expects it. Use /usr/local/bin/hugo (v0.147.4) explicitly.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vigilio Desto 2026-04-12 13:54:34 +02:00
parent fa9190abe1
commit defcb22cc4
Signed by: Vigo
GPG key ID: 159D6AD58C8E55E9
2 changed files with 4 additions and 5 deletions

View file

@ -3,7 +3,6 @@
set -euo pipefail
cd ~/projects/asw
git pull origin main --ff-only
npm ci --prefer-offline 2>/dev/null
npx postcss assets/css/main.css -o assets/css/asw-built.css
hugo
echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] Deploy complete" >> /tmp/asw-deploy.log
cd site
/usr/local/bin/hugo --destination ../public
echo "[$(date -u +%Y-%m-%dT%H:%M:%SZ)] Deploy complete ($(ls ../public/**/*.html 2>/dev/null | wc -l) pages)" >> /tmp/asw-deploy.log

View file

@ -1,7 +1,7 @@
<nav>
<ul><li><a href="/"><strong>{{ .Site.Title }}</strong></a></li></ul>
<ul data-nav-links>
{{- range sort hugo.Data.nav.items "weight" }}
{{- range sort .Site.Data.nav.items "weight" }}
<li><a href="{{ .url }}"{{ if eq (relURL .url) $.RelPermalink }} aria-current="page"{{ end }}>{{ .name }}</a></li>
{{- end }}
</ul>