1
Fork 0
theorangeone.net-legacy/layouts/partials/related-content.html
Jake Howard 7dd9793f03
Add related content to pages
Couldn't get it showing pages in the past, because Hugos docs on what the default are appear to be incorrect
2020-07-24 22:44:08 +01:00

21 lines
594 B
HTML

{{ if .Section }}
{{ $pages := where .Site.RegularPages "Section" .Section }}
{{ $related := ($pages.Related .) | first 3 }}
{{ if $related }}
{{ $col := printf "col-md-%d" (div 12 (len $related)) }}
<div class="container mt-5 text-center">
<h3 class="m-0">Related content</h3>
<div class="row">
{{ range $related }}
<div class="{{ $col }} mt-4">
<h5><a href="{{ .RelPermalink }}">{{ .Title }}</a></h5>
{{ partial "content-details.html" . }}
</div>
{{ end }}
</div>
</div>
{{ end }}
{{ end }}