assemble / grunt-assemble-permalinks

Permalinks middleware for Assemble, the static site generator for Grunt.js and Yeoman. This plugin enables powerful and configurable URI replacement patterns, presets, uses Moment.js for parsing dates, and much more.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Subfolder indexes omit permalinks structure

ain opened this issue · comments

Scenario for a tree:

root
|_ subfolder
    |_ index.html
    |_ content.html

In the above example, if the source template is called index.hbs, permalinks are fully ignored due to its basename which IMO is false/undocumented behaviour.

My suggestion would be to get rid of the logic at permalinks.js:184. It'd resolve #45.

@doowb what was the reason to check against basename at permalinks.js:184?

No, this is expected behavior.

#20
#25
#23
#40

Please research prior issues first.

My scenario was a website with subsections and sub-subsections where template structure mocks the actual product structure of the site, for seamless organisation, e.g.

section/
|_ subsection/
|  |_ index.hbs
|_ index.hbs
index.hbs

meaning, that there is an index as per section and subsection, a microsite within the site, if you will. If index.hbs is always pushed to root level regardless of it permalinks data, it feels wrong.

So you're saying that the most nested index file below:

section/
|_ subsection/
|  |_ index.hbs // <= this one
|_ index.hbs

is pushed all the way to the very root of the project? Indeed, that doesn't seem right. I'll have to look into it.

I made a quick and dirty hotfix around it earlier today, check the above PR for a lead.