update: "rssIcon" defaults to "true" && "readNextPosts" defaults to "3"

This commit is contained in:
Junyi Hou 2024-04-26 12:46:52 +08:00
parent e7a93e2088
commit 893f4a77a4
2 changed files with 13 additions and 3 deletions

View File

@ -22,8 +22,13 @@
</article> </article>
{{ if gt .Site.Params.readNextPosts 0 }} {{ $readNextPosts := 3}}
{{ $related := .Site.RegularPages.Related . | first .Site.Params.readNextPosts }} {{ if isset .Site.Params "readNextPosts" }}
{{ $readNextPosts := .Site.Params.readNextPosts }}
{{ end }}
{{ if gt $readNextPosts 0 }}
{{ $related := .Site.RegularPages.Related . | first $readNextPosts }}
{{ with $related }} {{ with $related }}
<h3 class="read-next-title noselect">{{ i18n "readNext" }}</h3> <h3 class="read-next-title noselect">{{ i18n "readNext" }}</h3>
<ul class="read-next-posts noselect"> <ul class="read-next-posts noselect">

View File

@ -24,7 +24,12 @@
{{ end }} {{ end }}
{{ end }} {{ end }}
{{ if .Site.Params.rssAsSocialIcon }} {{ $rssIcon := true }}
{{ if isset .Site.Params "rssIcon" }}
{{ $rssIcon = .Site.Params.rssIcon }}
{{ end }}
{{ if $rssIcon }}
{{ with .Site.Home.OutputFormats.Get "rss" -}} {{ with .Site.Home.OutputFormats.Get "rss" -}}
<li> <li>
<a {{ printf "href=%q" .RelPermalink | safeHTMLAttr }} title="RSS" rel="me"> <a {{ printf "href=%q" .RelPermalink | safeHTMLAttr }} title="RSS" rel="me">