relative images/URLs do not work in some feed readers. Thanks, Peter. See render-image.html
This commit is contained in:
parent
f1aea1a4af
commit
6a51a01e71
|
@ -1,6 +1,6 @@
|
||||||
<figure>
|
<figure>
|
||||||
<a href="{{ .Destination | safeURL }}" class="lbox">
|
<a href="{{ .Destination | safeURL }}" class="lbox">
|
||||||
<img loading="lazy" class="img-responsive" src="{{ .Destination | safeURL }}" {{ with .Text }} alt="{{ . }}"{{ end }} {{ with .Title}} title="{{ . }}" alt="{{ . }}"{{ end }}>
|
<img src="{{ .Destination | safeURL }}" loading="lazy" class="img-responsive"{{ with .Text }} alt="{{ . }}"{{ end }}{{ with .Title}} title="{{ . }}" alt="{{ . }}"{{ end }}>
|
||||||
</a>
|
</a>
|
||||||
{{ with .Title }}
|
{{ with .Title }}
|
||||||
<figcaption>{{ . }}</figcaption>
|
<figcaption>{{ . }}</figcaption>
|
||||||
|
|
|
@ -50,23 +50,26 @@
|
||||||
{{ $eagerLoadImg := "src=" }}
|
{{ $eagerLoadImg := "src=" }}
|
||||||
{{ $contentImg := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
|
{{ $contentImg := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
|
||||||
|
|
||||||
{{ $noscriptImg := "<noscript class=\"noscript-lazyload\">(.*)</noscript>" }}
|
{{ $content := .Content }}
|
||||||
{{ $content := $contentImg | replaceRE $noscriptImg "" | safeHTML }}
|
<!-- relative images/URLs do not work in some feed readers. Thanks, Peter. See render-image.html -->
|
||||||
|
{{ $content = replaceRE `a href="(#.*?)"` (printf "%s%s%s" "a href=\"" .Permalink "$1\"") $content }}
|
||||||
|
{{ $content = replaceRE `<img src="/(.*?)"` (printf "%s%s%s" "<img src=\"" $baseurl "$1\"") $content }}
|
||||||
|
{{ $content = replaceRE `a href="/(.*?)"` (printf "%s%s%s" "a href=\"" $baseurl "$1\"") $content }}
|
||||||
<description>
|
<description>
|
||||||
{{ `<![CDATA[ ` | safeHTML }}
|
{{ `<![CDATA[ ` | safeHTML }}
|
||||||
{{ $content | safeHTML }}
|
{{ $content | safeHTML }}
|
||||||
<p>
|
<p>
|
||||||
By <a href="/about">{{ .Site.Author.name }}</a> on <time datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}</time>.
|
By <a href="{{ $baseurl }}about">{{ .Site.Author.name }}</a> on <time datetime="{{ .Lastmod.Format "2006-01-02" }}">{{ .Lastmod.Format (.Site.Params.dateFormat | default "2 January 2006") }}</time>.
|
||||||
</p>
|
</p>
|
||||||
{{ if .Params.game_name }}
|
{{ if .Params.game_name }}
|
||||||
<hr/>
|
<hr/>
|
||||||
<p>
|
<p>
|
||||||
{{ with .Params.game_platform }}
|
{{ with .Params.game_platform }}
|
||||||
Played on: <a href="/platforms/{{ lower . }}">{{ . }}</a><br/>
|
Played on: <a href="{{ $baseurl }}platforms/{{ lower . }}">{{ . }}</a><br/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Params.game_genre }}
|
{{ with .Params.game_genre }}
|
||||||
{{ $tag := replaceRE `\s` "-" . }}
|
{{ $tag := replaceRE `\s` "-" . }}
|
||||||
Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
Genre: <a href="{{ $baseurl }}tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
{{ with .Params.game_release_year }}
|
{{ with .Params.game_release_year }}
|
||||||
Release year: {{ . }}<br/>
|
Release year: {{ . }}<br/>
|
||||||
|
|
Loading…
Reference in New Issue