assemble / grunt-assemble-i18n

Assemble middleware for adding i18n support to projects.
24 stars 8 forks source link

Keep folder structure inside language folder? #38

Closed julia-r closed 10 years ago

julia-r commented 10 years ago

When I use the "with-permalinks" option, the translated file will be put in a folder with the language name.:

foo/index.html -> foo/language/index.html

But I'd like the parent folder also to be into the language folder, like this:

foo/index.html -> language/foo/index.html

How can I do that?

ain commented 10 years ago

The output structure is defined by the assemble-contrib-permalinks.

You should define permalink structure in the options of your assemble subtask:

permalinks: {
  structure: ':language/:section/:slug:ext'
}

Please read through the assemble-contrib-permalinks documentation.

julia-r commented 10 years ago

Ah, thanks! I used the dynamically-build-slugs and added a :section parameter to my pages.

It would have been even better if it could recognize the parent folder name, but this works as well.

LaurentGoderre commented 10 years ago

:+: can we close ?

jonschlinkert commented 10 years ago

It would have been even better if it could recognize the parent folder name, but this works as well.

Take a look at: https://github.com/jonschlinkert/plasma/blob/master/test/dothash.js#L90-L116

This needs more testing, but I started implementing something to address use cases like this. essentially, the idea is to dynamically build objects using a similar structure to how permalinks works. kind of hard to explain, the test I linked to shows what I mean.