diff options
Diffstat (limited to 'tpl/tplimpl/embedded/templates/_default')
3 files changed, 15 insertions, 7 deletions
diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html index 013e31235..89514cb83 100644 --- a/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html +++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-image.html @@ -1,11 +1,18 @@ {{- $u := urls.Parse .Destination -}} {{- $src := $u.String -}} {{- if not $u.IsAbs -}} - {{- with or (.PageInner.Resources.Get $u.Path) (resources.Get $u.Path) -}} + {{- $path := strings.TrimPrefix "./" $u.Path }} + {{- with or (.PageInner.Resources.Get $path) (resources.Get $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) -}} +{{- $attributes := merge .Attributes (dict "alt" .Text "src" $src "title" (.Title | transform.HTMLEscape)) -}} <img {{- range $k, $v := $attributes -}} {{- if $v -}} diff --git a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html index 8903d3dfb..daf3f11e1 100644 --- a/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html +++ b/tpl/tplimpl/embedded/templates/_default/_markup/render-link.html @@ -3,10 +3,11 @@ {{- if strings.HasPrefix $u.String "#" }} {{- $href = printf "%s#%s" .PageInner.RelPermalink $u.Fragment }} {{- else if not $u.IsAbs -}} + {{- $path := strings.TrimPrefix "./" $u.Path }} {{- with or - ($.PageInner.GetPage $u.Path) - ($.PageInner.Resources.Get $u.Path) - (resources.Get $u.Path) + ($.PageInner.GetPage $path) + ($.PageInner.Resources.Get $path) + (resources.Get $path) -}} {{- $href = .RelPermalink -}} {{- with $u.RawQuery -}} @@ -17,7 +18,7 @@ {{- end -}} {{- end -}} {{- end -}} -{{- $attributes := dict "href" $href "title" .Title -}} +{{- $attributes := dict "href" $href "title" (.Title | transform.HTMLEscape) -}} <a {{- range $k, $v := $attributes -}} {{- if $v -}} diff --git a/tpl/tplimpl/embedded/templates/_default/rss.xml b/tpl/tplimpl/embedded/templates/_default/rss.xml index a3cade657..2e505f1bc 100644 --- a/tpl/tplimpl/embedded/templates/_default/rss.xml +++ b/tpl/tplimpl/embedded/templates/_default/rss.xml @@ -48,7 +48,7 @@ <title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{ . }} on {{ end }}{{ .Site.Title }}{{ end }}</title> <link>{{ .Permalink }}</link> <description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{ . }} {{ end }}{{ end }}on {{ .Site.Title }}</description> - <generator>Hugo {{ hugo.Version }}</generator> + <generator>Hugo</generator> <language>{{ site.Language.LanguageCode }}</language>{{ with $authorEmail }} <managingEditor>{{.}}{{ with $authorName }} ({{ . }}){{ end }}</managingEditor>{{ end }}{{ with $authorEmail }} <webMaster>{{ . }}{{ with $authorName }} ({{ . }}){{ end }}</webMaster>{{ end }}{{ with .Site.Copyright }} |