Files
website/hugo/layouts/_default/_markup/render-image.html
T
tobias 5e9da58d23 Vorlage fuer eigene Ableger-Installationen: Website + CMS-Code
Bereinigt von Pilot-Spezifika (echte Inhalte, Erzbistum-Hamburg-Bezuege,
Domain-Werte) - install.env und hugo.toml [params] mit generischen
Platzhaltern. docs/ komplett entfernt: Konzept, Manifest, Installations-
anleitungen leben jetzt auf der Projekt-Website statt redundant im Repo,
README verweist dorthin. Decap-CMS-Version von einer floatenden ^3.0.0
auf ein festes 3.15.1 gepinnt.
2026-08-23 14:37:54 +02:00

19 lines
904 B
HTML

{{/* We resolve image paths in variant content (![](datei.svg)) via the
page resources of the page the content belongs to (the variant) - not
the page that embeds .Content. With only one variant, the method page
(hugo/layouts/_default/single.html) embeds this content directly; a
raw relative path would resolve against the wrong URL there (the file
lives in the variant's bundle folder, not the method's). An absolute
permalink makes the embed location-independent. */}}
{{- $resource := "" }}
{{- if not (urls.Parse .Destination).IsAbs }}
{{- with .Page.Resources.GetMatch .Destination }}
{{- $resource = . }}
{{- end }}
{{- end }}
{{- if $resource }}
<img src="{{ $resource.Permalink }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }}>
{{- else }}
<img src="{{ .Destination }}" alt="{{ .Text }}"{{ with .Title }} title="{{ . }}"{{ end }}>
{{- end }}