2021-07-01 14:23:00 +02:00
|
|
|
{{- $allowedRssSections := (slice "articles" "games") -}}
|
2020-04-14 12:32:42 +02:00
|
|
|
{{- $baseurl := .Site.BaseURL -}}
|
|
|
|
{{- $pctx := . -}}
|
|
|
|
{{- if .IsHome -}}{{ $pctx = .Site }}{{- end -}}
|
|
|
|
{{- $pages := slice -}}
|
|
|
|
{{- if or $.IsHome $.IsSection -}}
|
|
|
|
{{- $pages = $pctx.RegularPages -}}
|
|
|
|
{{- else -}}
|
|
|
|
{{- $pages = $pctx.Pages -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- $limit := .Site.Config.Services.RSS.Limit -}}
|
|
|
|
{{- if ge $limit 1 -}}
|
|
|
|
{{- $pages = $pages | first $limit -}}
|
|
|
|
{{- end -}}
|
|
|
|
{{- printf "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"yes\"?>" | safeHTML }}
|
2021-06-01 11:18:57 +02:00
|
|
|
{{- printf "<?xml-stylesheet href=\"/pretty-feed-v3.xsl\" type=\"text/xsl\"?>" | safeHTML }}
|
2020-04-14 12:32:42 +02:00
|
|
|
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
|
|
|
|
<channel>
|
|
|
|
<title>{{ if eq .Title .Site.Title }}{{ .Site.Title }}{{ else }}{{ with .Title }}{{.}} on {{ end }}{{ .Site.Title }}{{ end }}</title>
|
|
|
|
<link>{{ .Permalink }}</link>
|
|
|
|
<description>Recent content {{ if ne .Title .Site.Title }}{{ with .Title }}in {{.}} {{ end }}{{ end }}on {{ .Site.Title }}</description>
|
|
|
|
<generator>Hugo -- gohugo.io</generator>{{ with .Site.LanguageCode }}
|
|
|
|
<language>{{.}}</language>{{end}}{{ with .Site.Author.email }}
|
|
|
|
<managingEditor>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</managingEditor>{{end}}{{ with .Site.Author.email }}
|
|
|
|
<webMaster>{{.}}{{ with $.Site.Author.name }} ({{.}}){{end}}</webMaster>{{end}}{{ with .Site.Copyright }}
|
|
|
|
<copyright>{{.}}</copyright>{{end}}{{ if not .Date.IsZero }}
|
|
|
|
<lastBuildDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</lastBuildDate>{{ end }}
|
|
|
|
{{ with .OutputFormats.Get "RSS" }}
|
|
|
|
{{ printf "<atom:link href=%q rel=\"self\" type=%q />" .Permalink .MediaType | safeHTML }}
|
|
|
|
{{ end }}
|
|
|
|
{{ range $pages }}
|
2021-03-19 21:34:19 +01:00
|
|
|
{{ if in $allowedRssSections .Section }}
|
2020-04-14 12:32:42 +02:00
|
|
|
<item>
|
|
|
|
<title>{{ .Title }}</title>
|
|
|
|
<link>{{ .Permalink }}</link>
|
2021-03-18 11:22:23 +01:00
|
|
|
<comments>{{ .Site.Author.mastodonlink }}</comments>
|
2020-04-14 12:32:42 +02:00
|
|
|
<pubDate>{{ .Date.Format "Mon, 02 Jan 2006 15:04:05 -0700" | safeHTML }}</pubDate>
|
2021-06-01 11:18:57 +02:00
|
|
|
<author>{{ with $.Site.Author.name }} {{.}}{{end}}</author>
|
2020-04-14 12:32:42 +02:00
|
|
|
<guid>{{ .Permalink }}</guid>
|
2020-11-25 08:57:24 +01:00
|
|
|
{{ if .Keywords }}
|
|
|
|
{{ range .Keywords }}
|
|
|
|
<category>{{ . }}</category>
|
|
|
|
{{ end }}
|
|
|
|
{{ else if .Params.tags }}
|
|
|
|
{{ range .Params.tags }}
|
|
|
|
<category>{{ . }}</category>
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
2021-01-05 15:38:51 +01:00
|
|
|
{{ $lazyLoadImg := "data-src=" }}
|
|
|
|
{{ $eagerLoadImg := "src=" }}
|
2021-01-09 11:09:29 +01:00
|
|
|
{{ $contentImg := .Content | replaceRE $lazyLoadImg $eagerLoadImg | safeHTML }}
|
|
|
|
|
|
|
|
{{ $noscriptImg := "<noscript class=\"noscript-lazyload\">(.*)</noscript>" }}
|
|
|
|
{{ $content := $contentImg | replaceRE $noscriptImg "" | safeHTML }}
|
2020-04-14 12:32:42 +02:00
|
|
|
<description>
|
2021-01-05 15:38:51 +01:00
|
|
|
{{ `<![CDATA[ ` | safeHTML }}
|
|
|
|
{{ $content | safeHTML }}
|
2021-01-05 17:17:22 +01:00
|
|
|
<p>
|
2021-03-24 16:03:29 +01:00
|
|
|
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>.
|
|
|
|
</p>
|
2021-07-02 11:56:19 +02:00
|
|
|
{{ if .Params.game_name }}
|
|
|
|
<hr/>
|
|
|
|
<p>
|
|
|
|
{{ with .Params.game_platform }}
|
|
|
|
Played on: <a href="/platforms/{{ lower . }}">{{ . }}</a><br/>
|
|
|
|
{{ end }}
|
|
|
|
{{ with .Params.game_genre }}
|
|
|
|
{{ $tag := replaceRE `\s` "-" . }}
|
|
|
|
Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
|
|
|
|
{{ end }}
|
|
|
|
{{ with .Params.game_release_year }}
|
|
|
|
Release year: {{ . }}<br/>
|
|
|
|
{{ end }}
|
|
|
|
{{ with .Params.game_developer }}
|
|
|
|
Developer: {{ . }}<br/>
|
|
|
|
{{ end }}
|
|
|
|
{{ with .Params.howlongtobeat_hrs }}
|
|
|
|
How long to beat: <code>{{ . }}</code> hours<br/>
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $thumb := "" }}
|
|
|
|
{{ if .Params.image }}
|
|
|
|
{{ $thumb = .Params.image }}
|
|
|
|
{{ else }}
|
|
|
|
{{ if .Params.howlongtobeat_id }}
|
|
|
|
{{ $thumb = printf "%s%d%s" "img/hltb/" .Params.howlongtobeat_id ".jpg" }}
|
|
|
|
{{ end }}
|
|
|
|
{{ end }}
|
|
|
|
{{ if ne $thumb "" }}
|
|
|
|
<img src="{{ $.Site.BaseURL }}{{ $thumb }}" alt="game cover image" alt="game cover" style="border: 1px solid black"/>
|
|
|
|
{{ end }}
|
|
|
|
</p>
|
|
|
|
{{ end }}
|
2020-04-14 12:32:42 +02:00
|
|
|
]]>
|
|
|
|
</description>
|
|
|
|
</item>
|
|
|
|
{{ end }}
|
2021-03-19 21:34:19 +01:00
|
|
|
{{ end }}
|
2020-04-14 12:32:42 +02:00
|
|
|
</channel>
|
|
|
|
</rss>
|