fixed wrong generated URLs
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 14s

This commit is contained in:
khannurien
2026-08-17 16:34:52 +00:00
parent d822cdaa6a
commit 8cf807df31
11 changed files with 2773 additions and 63 deletions

View File

@@ -86,29 +86,25 @@
</div>
{{- $section := .Section }}
{{- if $section }}
{{- $pfx := printf "/%s" $section }}
{{- /* Paths are passed to relURL *without* a leading slash: relURL only
prepends the baseURL subpath (e.g. /owner/repo/) for inputs that
are not already root-relative. .RelPermalink carries that same
prefix, so the active check compares like with like. */ -}}
<ul id="menu" class="menu">
{{- range slice "venues" "calendar" "digests" }}
{{- $url := printf "%s/%s/" $section . | relURL }}
<li>
<a href="{{ $pfx }}/venues/" title="Venues">
<span{{- if hasPrefix .RelPermalink (printf "%s/venues/" $pfx) }} class="active"{{- end }}>Venues</span>
</a>
</li>
<li>
<a href="{{ $pfx }}/calendar/" title="Calendar">
<span{{- if hasPrefix .RelPermalink (printf "%s/calendar/" $pfx) }} class="active"{{- end }}>Calendar</span>
</a>
</li>
<li>
<a href="{{ $pfx }}/digests/" title="Digests">
<span{{- if hasPrefix .RelPermalink (printf "%s/digests/" $pfx) }} class="active"{{- end }}>Digests</span>
<a href="{{ $url }}" title="{{ . | title }}">
<span{{- if hasPrefix $.RelPermalink $url }} class="active"{{- end }}>{{ . | title }}</span>
</a>
</li>
{{- end }}
</ul>
{{- else }}
<ul id="menu" class="menu">
{{- range hugo.Data.topics.topics }}
<li>
<a href="/{{ .slug }}/" title="{{ .title }}">
<a href="{{ printf "%s/" .slug | relURL }}" title="{{ .title }}">
<span>{{ .title }}</span>
</a>
</li>