fix RSS en lazyload imgs

This commit is contained in:
Wouter Groeneveld 2021-01-05 15:38:51 +01:00
parent 0241d352b3
commit 6e8fa7ad70
4 changed files with 23 additions and 8 deletions

View File

@ -11,7 +11,7 @@ summaryLength = 20
[Author]
name = "Wouter Groeneveld"
email = "wouter.groeneveld@gmail.com"
email = "wouter@brainbaking.com"
[markup]
defaultMarkdownHandler = "goldmark"

View File

@ -199,7 +199,7 @@ article
background-image: none
p, li
text-align: justify !important
text-align: left !important
.no-border

View File

@ -43,10 +43,18 @@
<category>{{ . }}</category>
{{ end }}
{{ end }}
{{ $lazyLoadImg := "data-src=" }}
{{ $eagerLoadImg := "src=" }}
{{ $content := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
<description>
{{ `<![CDATA[ ` | safeHTML }}<img align="left" hspace="5" src="{{ $baseurl }}{{ .Params.image }}"/>
{{ `<![CDATA[ ` | safeHTML }}
{{ if .Params.image }}
<p>
<img hspace="5" src="{{ $baseurl }}{{ .Params.image }}"/>
</p>
{{ end }}
{{ .Summary | html }}
{{ $content | safeHTML }}
]]>
</description>
</item>

View File

@ -1,7 +1,14 @@
<html>
<head>
{{ with .OutputFormats.Get "RSS" }}
<link href="{{ .RelPermalink }}" rel="alternate" type="application/rss+xml" title="Jefklak's Codex" />
<link href="{{ .RelPermalink }}" rel="feed" type="application/rss+xml" title="Jefklak's Codex" />
{{ end }}
{{ range .Site.Params.navlinks }}
{{ if .home }}
<meta http-equiv="refresh" content="0; URL={{ .url | absURL }}" />
{{ if .home }}
<meta http-equiv="refresh" content="0; URL={{ .url | absURL }}" />
{{ end }}
{{ end }}
{{ end }}
</head>
</head>
</html>