mirror of
https://github.com/jbowdre/runtimeterror.git
synced 2024-11-26 17:02:17 +00:00
add related posts to sidebar
This commit is contained in:
parent
b80e8aa617
commit
f30b368cf6
2 changed files with 20 additions and 0 deletions
|
@ -4,6 +4,7 @@ description = "while (true) { bugs++; }"
|
|||
mainSections = ["posts"]
|
||||
fallBackOgImage = "images/broken-computer.svg"
|
||||
numberOfFeaturedPosts = 5
|
||||
numberOfRelatedPosts = 5
|
||||
author = "codesplice"
|
||||
|
||||
indexTitle = ".-. ..- -. - .. -- . - . .-. .-. --- .-."
|
||||
|
|
|
@ -22,6 +22,25 @@
|
|||
<hr>
|
||||
{{ end }}
|
||||
|
||||
{{ if isset .Params "series" }}
|
||||
{{$related := where .Site.RegularPages ".Params.series" "eq" .Params.series }}
|
||||
{{- $relatedLimit := default 8 .Site.Params.numberOfRelatedPosts }}
|
||||
<h2>More {{ .Params.series }}</h2>
|
||||
<ul>
|
||||
{{- range first $relatedLimit $related }}
|
||||
<li>
|
||||
<a href="{{ .Permalink }}" title="{{ .Title }}">{{ .Title | markdownify }}</a>
|
||||
</li>
|
||||
{{ end }}
|
||||
{{ if gt (len $related) $relatedLimit }}
|
||||
<li>
|
||||
<a href="/series/{{ lower .Params.series }}/"><i>See all {{ .Params.series }}</i></a>
|
||||
</li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
<hr>
|
||||
{{ end }}
|
||||
|
||||
{{- $posts := where .Site.RegularPages "Type" "in" .Site.Params.mainSections }}
|
||||
{{- $featured := default 8 .Site.Params.numberOfFeaturedPosts }}
|
||||
{{- $featuredPosts := first $featured (where $posts "Params.featured" true)}}
|
||||
|
|
Loading…
Reference in a new issue