fix Feedly images displayed twice in RSS

This commit is contained in:
Wouter Groeneveld 2021-01-09 11:09:29 +01:00
parent f294ab4707
commit 12be2c8bb7
2 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,6 @@
<figure>
<a href="{{ .Destination | safeURL }}" class="lbox">
<noscript>
<img src="{{ .Destination | safeURL }}" {{ with .Text }} alt="{{ . }}"{{ end }} {{ with .Title}} title="{{ . }}"{{ end }}>
</noscript>
<noscript class="noscript-lazyload"><img src="{{ .Destination | safeURL }}" {{ with .Text }} alt="{{ . }}"{{ end }} {{ with .Title}} title="{{ . }}"{{ end }}></noscript>
<img class="lazyload img-responsive" data-src="{{ .Destination | safeURL }}" {{ with .Text }} alt="{{ . }}"{{ end }} {{ with .Title}} title="{{ . }}" alt="{{ . }}"{{ end }}>
</a>
{{ with .Title }}

View File

@ -45,7 +45,10 @@
{{ end }}
{{ $lazyLoadImg := "data-src=" }}
{{ $eagerLoadImg := "src=" }}
{{ $content := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
{{ $contentImg := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
{{ $noscriptImg := "<noscript class=\"noscript-lazyload\">(.*)</noscript>" }}
{{ $content := $contentImg | replaceRE $noscriptImg "" | safeHTML }}
<description>
{{ `<![CDATA[ ` | safeHTML }}
{{ if .Params.image }}