I'm very new at Yeoman and Assemble and I'm trying to build a navigation structure with subdirectories. I can loop through the main pages within the templates/pages directory with this:
{{#each pages}}
<li{{#if this.isCurrentPage}} class="active"{{/if}}>
<a href="{{relative dest this.dest}}">{{ data.title }}</a>
</li>
{{/each}}
Of course that does not account for subdirectories within the pages directory. This is what the assemble task of my Gruntfile looks like:
assemble: {
pages: {
options: {
flatten: true,
assets: '<%= config.dist %>/assets/',
layout: '<%= config.src %>/templates/layouts/default.hbs',
data: '<%= config.src %>/data/*.{json,yml}',
partials: '<%= config.src %>/templates/partials/*.hbs',
plugins: ['assemble-contrib-permalinks'],
},
files: {
'<%= config.dist %>/': ['<%= config.src %>/templates/pages/**/*.hbs']
}
}
}
What I want is to end up with a nested list that would expose pages within a subdirectory. Is there any somewhat straightforward way of doing this within the loop or do I need to think about hardcoding this?