From 9de7eab3536d18d4d8b7ad5395b18597edbc5bee Mon Sep 17 00:00:00 2001 From: Michael Rose Date: Tue, 4 Dec 2018 14:17:54 -0500 Subject: [PATCH] Allow sidebar navs with custom sidebar content Multiple sidebar navs can also be included on a page: ``` sidebar: - title: Navigation 1 nav: nav1 - title: Navigation 2 nav: nav2 ``` Fixes #1986 --- _includes/sidebar.html | 1 + docs/_posts/2012-03-15-layout-sidebar-custom.md | 1 + test/_posts/2012-03-15-layout-sidebar-custom.md | 3 +-- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/_includes/sidebar.html b/_includes/sidebar.html index 9dc6a3c3..2a1884ed 100644 --- a/_includes/sidebar.html +++ b/_includes/sidebar.html @@ -14,6 +14,7 @@ {% endif %} {% if s.title %}

{{ s.title }}

{% endif %} {% if s.text %}{{ s.text | markdownify }}{% endif %} + {% if s.nav %}{% include nav_list nav=s.nav %}{% endif %} {% endfor %} {% if page.sidebar.nav %} {% include nav_list nav=page.sidebar.nav %} diff --git a/docs/_posts/2012-03-15-layout-sidebar-custom.md b/docs/_posts/2012-03-15-layout-sidebar-custom.md index ee49173e..13497dd5 100644 --- a/docs/_posts/2012-03-15-layout-sidebar-custom.md +++ b/docs/_posts/2012-03-15-layout-sidebar-custom.md @@ -9,6 +9,7 @@ sidebar: text: "Some text here." - title: "Another Title" text: "More text here." + nav: sidebar-sample --- This post has a custom sidebar set in the post's YAML Front Matter. diff --git a/test/_posts/2012-03-15-layout-sidebar-custom.md b/test/_posts/2012-03-15-layout-sidebar-custom.md index ee49173e..91f1aa44 100644 --- a/test/_posts/2012-03-15-layout-sidebar-custom.md +++ b/test/_posts/2012-03-15-layout-sidebar-custom.md @@ -7,8 +7,7 @@ sidebar: image: http://placehold.it/350x250 image_alt: "image" text: "Some text here." - - title: "Another Title" - text: "More text here." + nav: sidebar-sample --- This post has a custom sidebar set in the post's YAML Front Matter.