fixed wrong generated URLs
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 14s
All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 14s
This commit is contained in:
10
site/layouts/_default/_markup/render-link.html
Normal file
10
site/layouts/_default/_markup/render-link.html
Normal 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>
|
||||
Reference in New Issue
Block a user