Skip to content

Commit

Permalink
Allow sidebar navs with custom sidebar content
Browse files Browse the repository at this point in the history
Multiple sidebar navs can also be included on a page:

```
sidebar:
  - title: Navigation 1
    nav: nav1
  - title: Navigation 2
    nav: nav2
```

Fixes mmistakes#1986
  • Loading branch information
mmistakes committed Dec 4, 2018
1 parent 1778bdf commit 21eb6e7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions _includes/sidebar.html
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
{% endif %}
{% if s.title %}<h3>{{ s.title }}</h3>{% 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 %}
Expand Down
1 change: 1 addition & 0 deletions docs/_posts/2012-03-15-layout-sidebar-custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
3 changes: 1 addition & 2 deletions test/_posts/2012-03-15-layout-sidebar-custom.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 21eb6e7

Please sign in to comment.