relative images/URLs do not work in some feed readers. Thanks, Peter. See render-image.html
This commit is contained in:
parent
1def5cdd7e
commit
1c78006b68
|
@ -1,6 +1,6 @@
|
|||
<figure>
|
||||
<a href="{{ .Destination | safeURL }}" class="lbox">
|
||||
<img loading="lazy" src="{{ .Destination | safeURL }}" {{ with .Text }} alt="{{ . }}"{{ end }} {{ with .Title}} title="{{ . }}"{{ end }}>
|
||||
<img src="{{ .Destination | safeURL }}" loading="lazy"{{ with .Text }} alt="{{ . }}"{{ end }}{{ with .Title}} title="{{ . }}"{{ end }}>
|
||||
</a>
|
||||
{{ with .Title }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
|
|
|
@ -47,7 +47,11 @@
|
|||
{{ end }}
|
||||
{{ end }}
|
||||
|
||||
{{ $content := .Content | safeHTML }}
|
||||
{{ $content := .Content }}
|
||||
<!-- relative images/URLs do not work in some feed readers. Thanks, Peter. See render-image.html -->
|
||||
{{ $content = replaceRE `<img src="../(.*?)"` (printf "%s%s%s" "<img src=\"" .Permalink "../$1\"") $content }}
|
||||
{{ $content = replaceRE `a href="(#.*?)"` (printf "%s%s%s" "a href=\"" .Permalink "$1\"") $content }}
|
||||
{{ $content = replaceRE `a href="../(.*?)"` (printf "%s%s%s" "a href=\"" .Permalink "../$1\"") $content }}
|
||||
<description>
|
||||
{{ `<![CDATA[ ` | safeHTML }}
|
||||
{{ if .Params.bigimg }}
|
||||
|
@ -56,7 +60,7 @@
|
|||
</p>
|
||||
{{ end }}
|
||||
|
||||
{{ $content }}
|
||||
{{ $content | safeHTML }}
|
||||
|
||||
<p>
|
||||
By <a href="/about">{{ .Site.Author.name }}</a> on {{ .Date.Format "2 January 2006" }}.
|
||||
|
|
Loading…
Reference in New Issue