[doc] Add option to select the active sidebar item

If the page contains the variable "sidebaractiveurl" in the yaml
frontmatter, this is additionally used to select the active item
in the sidebar. Useful, if the page doesn't have its own item,
but wants to activate e.g. the parent page.
This commit is contained in:
Andreas Dangel
2017-07-28 11:34:59 +02:00
parent 236154100f
commit 509acb6d8f

View File

@ -12,7 +12,7 @@
{% if folderitem.output contains "web" %}
{% if folderitem.external_url %}
<li><a href="{{folderitem.external_url}}" target="_blank">{{folderitem.title}}</a></li>
{% elsif page.url == folderitem.url %}
{% elsif page.url == folderitem.url or page.sidebaractiveurl == folderitem.url %}
<li class="active"><a href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>
{% else %}
<li><a href="{{folderitem.url | remove: "/"}}">{{folderitem.title}}</a></li>