tpl/tplimpl: Retain query string and fragment in render-image.html

Closes #12468
This commit is contained in:
Joe Mooring
2024-05-07 10:12:19 -07:00
committed by Bjørn Erik Pedersen
parent ca9a77ef92
commit 6dfeb9f038
2 changed files with 17 additions and 7 deletions

View File

@@ -3,6 +3,12 @@
{{- if not $u.IsAbs -}}
{{- with or (.PageInner.Resources.Get $u.Path) (resources.Get $u.Path) -}}
{{- $src = .RelPermalink -}}
{{- with $u.RawQuery -}}
{{- $src = printf "%s?%s" $src . -}}
{{- end -}}
{{- with $u.Fragment -}}
{{- $src = printf "%s#%s" $src . -}}
{{- end -}}
{{- end -}}
{{- end -}}
{{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" (.Title | transform.HTMLEscape)) -}}