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] [Author]
name = "Wouter Groeneveld" name = "Wouter Groeneveld"
email = "wouter.groeneveld@gmail.com" email = "wouter@brainbaking.com"
[markup] [markup]
defaultMarkdownHandler = "goldmark" defaultMarkdownHandler = "goldmark"

View File

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

View File

@ -43,10 +43,18 @@
<category>{{ . }}</category> <category>{{ . }}</category>
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ $lazyLoadImg := "data-src=" }}
{{ $eagerLoadImg := "src=" }}
{{ $content := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
<description> <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> </description>
</item> </item>

View File

@ -1,7 +1,14 @@
<html>
<head> <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 }} {{ range .Site.Params.navlinks }}
{{ if .home }} {{ if .home }}
<meta http-equiv="refresh" content="0; URL={{ .url | absURL }}" /> <meta http-equiv="refresh" content="0; URL={{ .url | absURL }}" />
{{ end }}
{{ end }} {{ end }}
{{ end }} </head>
</head> </html>