mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-26 22:04:32 +02:00
tpl/tplimpl: Retain query string and fragment in render-image.html
Closes #12468
This commit is contained in:
committed by
Bjørn Erik Pedersen
parent
ca9a77ef92
commit
6dfeb9f038
@@ -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)) -}}
|
||||
|
Reference in New Issue
Block a user