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

@@ -0,0 +1,10 @@
{{- /* Generated content links to root-relative paths (/cloud-edge/venues/…),
which ignore the subdirectory in baseURL and 404 when the site is served
from e.g. https://pub.sqrt.fr/vincent/publish-assistant/. relURL prepends
that subpath, but only for inputs without a leading slash — hence the
trim. No-op when the site is served from the domain root. */ -}}
{{- $dest := .Destination -}}
{{- if and (hasPrefix $dest "/") (not (hasPrefix $dest "//")) -}}
{{- $dest = strings.TrimPrefix "/" $dest | relURL -}}
{{- end -}}
<a href="{{ $dest | safeURL }}"{{ with .Title }} title="{{ . }}"{{ end }}>{{ .Text | safeHTML }}</a>

View File

@@ -4,7 +4,16 @@
<h1>{{ .Title }}</h1>
</header>
<div id="pa-calendar" data-events="{{ .Params.events | jsonify }}"></div>
{{- /* Event urls are stored root-relative; strip the leading slash so relURL
prepends the baseURL subpath, keeping event clicks working when the site
is served from a subdirectory. */ -}}
{{- $events := slice }}
{{- range .Params.events }}
{{- $e := . }}
{{- with .url }}{{ $e = merge $e (dict "url" (strings.TrimPrefix "/" . | relURL)) }}{{ end }}
{{- $events = $events | append $e }}
{{- end }}
<div id="pa-calendar" data-events="{{ $events | jsonify }}"></div>
{{- if .Content }}
<div class="md-content">