add sidebar info to rss feed, limit to 50

This commit is contained in:
Wouter Groeneveld 2021-07-02 11:56:19 +02:00
parent 2d6380feec
commit ae82b25027
5 changed files with 41 additions and 13 deletions

View File

@ -10,6 +10,9 @@ enableRobotsTXT = true
summaryLength = 20
paginate = 20
[services.rss]
limit = 50
[Author]
name = "Jefklak"
email = "jef@jefklakscodex.com"

View File

@ -107,7 +107,7 @@ hr
border-top: 1px solid var(--accent)
#csslink
#rsslink
position: absolute
right: 0
z-index: 99

View File

@ -9,11 +9,9 @@
<a href="#top">skip to main content</a>
</div>
{{ with .OutputFormats.Get "RSS" }}
<a href="{{ .RelPermalink }}" id="csslink" class="no-border">
<img src="/img/rss.png" alt="get RSS feed" class="no-border" />
</a>
{{ end }}
<a href="/index.xml" id="rsslink" class="no-border">
<img src="/img/rss.png" alt="get RSS feed" class="no-border" />
</a>
<div id="all">
<div class="container-fluid">
<div class="row row-offcanvas row-offcanvas-left">

View File

@ -54,16 +54,43 @@
{{ $content := $contentImg | replaceRE $noscriptImg "" | safeHTML }}
<description>
{{ `<![CDATA[ ` | safeHTML }}
{{ if .Params.image }}
<p>
<img hspace="5" src="{{ $baseurl }}{{ .Params.image }}"/>
</p>
{{ end }}
{{ $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>.
</p>
{{ if .Params.game_name }}
<hr/>
<p>
{{ with .Params.game_platform }}
&nbsp;Played on: <a href="/platforms/{{ lower . }}">{{ . }}</a><br/>
{{ end }}
{{ with .Params.game_genre }}
{{ $tag := replaceRE `\s` "-" . }}
&nbsp;Genre: <a href="/tags/{{ $tag | lower }}">{{ . }}</a><br/>
{{ end }}
{{ with .Params.game_release_year }}
&nbsp;Release year: {{ . }}<br/>
{{ end }}
{{ with .Params.game_developer }}
&nbsp;Developer: {{ . }}<br/>
{{ end }}
{{ with .Params.howlongtobeat_hrs }}
&nbsp;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 }}
]]>
</description>
</item>

View File

@ -37,7 +37,7 @@
<meta property="og:url" content="{{ $perm }}" />
<meta property="og:type" content="{{ if .Params.type }}{{ .Params.type }}{{ else }}website{{ end }}" />
{{ $thumb := "img/logo.png" | absURL }}
{{ $thumb := "img/favicon.png" | absURL }}
{{ if .Params.image }}
{{ $thumb = .Params.image | absURL }}
{{ else if .Params.howlongtobeat_id }}