Add Related Content to sidebar

This commit is contained in:
budparr 2018-04-09 11:38:06 -04:00
parent 54b6dca78a
commit ebb7dc3b45
No known key found for this signature in database
GPG Key ID: 05AB7813F9C39728

View File

@ -1,6 +1,23 @@
{{- if .Params.toc -}}
<div class="bg-light-gray mb-4 pa3 nested-list-reset nested-copy-line-height nested-links">
<p class="list b mb3">What's in this {{ humanize .Type }}</p>
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
<p class="f5 b mb3">What's in this {{ humanize .Type }}</p>
{{ .TableOfContents }}
</div>
{{- end -}}
{{ $related := .Site.RegularPages.Related . | first 15 }}
{{ with $related }}
<div class="bg-light-gray pa3 nested-list-reset nested-copy-line-height nested-links">
<p class="f5 b mb3">Related</p>
<ul class="pa0 list">
{{ range . }}
<li class="mb2">
<a href="{{ .RelPermalink }}">
{{- .Title -}}
</a>
</li>
{{ end }}
</ul>
</div>
{{ end }}