Skip to content

Commit 21eb6e7

Browse files
committedDec 4, 2018
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 mmistakes#1986
1 parent 1778bdf commit 21eb6e7

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed
 

‎_includes/sidebar.html

+1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
{% endif %}
1515
{% if s.title %}<h3>{{ s.title }}</h3>{% endif %}
1616
{% if s.text %}{{ s.text | markdownify }}{% endif %}
17+
{% if s.nav %}{% include nav_list nav=s.nav %}{% endif %}
1718
{% endfor %}
1819
{% if page.sidebar.nav %}
1920
{% include nav_list nav=page.sidebar.nav %}

‎docs/_posts/2012-03-15-layout-sidebar-custom.md

+1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ sidebar:
99
text: "Some text here."
1010
- title: "Another Title"
1111
text: "More text here."
12+
nav: sidebar-sample
1213
---
1314

1415
This post has a custom sidebar set in the post's YAML Front Matter.

‎test/_posts/2012-03-15-layout-sidebar-custom.md

+1-2
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,7 @@ sidebar:
77
image: http://placehold.it/350x250
88
image_alt: "image"
99
text: "Some text here."
10-
- title: "Another Title"
11-
text: "More text here."
10+
nav: sidebar-sample
1211
---
1312

1413
This post has a custom sidebar set in the post's YAML Front Matter.

0 commit comments

Comments
 (0)
Please sign in to comment.