Let's say I have a website where for each main section I have a specific sidebar.
Currently I have a single sidebar file, where im using categories to filter the correct content to show like this:
{{#inArray page.categories "Components"}}
<section class="sg-index">
<ul>
<li {{#is title "DetailContent"}} class="active"{{/is}}>
<a href="c-DetailContent.html">DetailContent</a>
</li>
However my goal is to have these sidebar files located at each section folder, along with the section files.
How can I include the {{dirname}} variable in the partials call {{> sidebar}}?
This should be possible with a conditional block helper, like
{{with}}
and the include helper,B you could also create a custom helper, something like this:
then use it in your markup like this: