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.
MIT License
43 stars 11 forks source link

Subfolder indexes omit permalinks structure #46

Closed ain closed 10 years ago

ain commented 10 years ago

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.

ain commented 10 years ago

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

jonschlinkert commented 10 years ago

No, this is expected behavior.

jonschlinkert commented 10 years ago

https://github.com/assemble/assemble-contrib-permalinks/issues/20 https://github.com/assemble/assemble-contrib-permalinks/pull/25 https://github.com/assemble/assemble-contrib-permalinks/pull/23 https://github.com/assemble/assemble-contrib-permalinks/pull/40

Please research prior issues first.

ain commented 10 years ago

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.

jonschlinkert commented 10 years ago

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.

ain commented 10 years ago

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