Hello ! I’m currently building a multilingual blog and i’m quite lost with routing.
I don’t only need posts in a certain language (which can be achieved using tag filter on routing) but also the global context of the website, including categories url on menu.
So, i made a template (hbs) for each categories where i filter directly on the post loop. Which is working well actually.
Now my problem is my routing. It’s looking like that :
routes:
collections:
/:
permalink: /{slug}/
template: index
filter: ‘tag:fr’
/tips-tactics-strategies/:
permalink: /tips-tactics-strategies/
template: categories/strategies
/product/:
permalink: /product/
template: categories/product
/news/:
permalink: /news/
template: categories/news
/guides/:
permalink: /guides/
template: categories/guides/en/:
permalink: /en/{slug}/
template: multilingual/en/index
filter: ‘tag:en’
/en/tips-tactics-strategies/:
permalink: /en/tips-tactics-strategies/
template: multilingual/en/categories/strategies
/en/product/:
permalink: /en/product/
template: multilingual/en/categories/product
/en/news/:
permalink: /en/news/
template: multilingual/en/categories/news
/en/guides/:
permalink: /en/guides/
template: multilingual/en/categories/guidestaxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
It’s a bit overkill but i want all the website (menu, footer…) to be localized and it did’nt saw how to make conditions on lang variable…{{#has {{lang}}=“en”}}{{/has}} do not seems to be an option. Or maybe i’m doing it wrong
The problem with this routing is that when im on /en/ , the post url are redirected to /tipcs-tactics-strategies/…because of routing priority i guess.
Any help on those subjects ? Thank you very much :)