From ebb7dc3b45615155cc58c0f03b0a0f89c6610f7d Mon Sep 17 00:00:00 2001
From: budparr <budparr@gmail.com>
Date: Mon, 09 Apr 2018 15:38:06 +0000
Subject: [PATCH] Add Related Content to sidebar
---
layouts/partials/menu-contextual.html | 21 +++++++++++++++++++--
1 files changed, 19 insertions(+), 2 deletions(-)
diff --git a/layouts/partials/menu-contextual.html b/layouts/partials/menu-contextual.html
index d564c3b..cf0cccc 100644
--- a/layouts/partials/menu-contextual.html
+++ b/layouts/partials/menu-contextual.html
@@ -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 }}
--
Gitblit v1.10.0