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>
|
||||
<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>
|
||||
{{ with .Title }}
|
||||
<figcaption>{{ . }}</figcaption>
|
||||
|
|
|
@ -50,23 +50,26 @@
|
|||
{{ $eagerLoadImg := "src=" }}
|
||||
{{ $contentImg := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
|
||||
|
||||
{{ $noscriptImg := "<noscript class=\"noscript-lazyload\">(.*)</noscript>" }}
|
||||
{{ $content := $contentImg | replaceRE $noscriptImg "" | safeHTML }}
|
||||
{{ $content := .Content }}
|
||||
<!-- 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>
|
||||
{{ `<![CDATA[ ` | safeHTML }}
|
||||
{{ $content | safeHTML }}
|
||||
<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>
|
||||
{{ if .Params.game_name }}
|
||||
<hr/>
|
||||
<p>
|
||||
{{ with .Params.game_platform }}
|
||||
Played on: <a href="/platforms/{{ lower . }}">{{ . }}</a><br/>
|
||||
Played on: <a href="{{ $baseurl }}platforms/{{ lower . }}">{{ . }}</a><br/>
|
||||
{{ end }}
|
||||
{{ with .Params.game_genre }}
|
||||
{{ $tag := replaceRE `\s` "-" . }}
|
||||
Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
||||
Genre: <a href="{{ $baseurl }}tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
||||
{{ end }}
|
||||
{{ with .Params.game_release_year }}
|
||||
Release year: {{ . }}<br/>
|
||||
|
|
Loading…
Reference in New Issue