Closed BeMrTeal closed 7 months ago
I see that in the LogRhythm website you have subdomains for languages but how do you build the home pages in different languages? Do you have a different layout for each language? How did you set it so you can have Jekyll to build it?
I'd love to have a tip on how to do that for my site.
Hey @bernardomed,
So I cannot tell you how the Logrhythm website does it's full layout. In fact they made recent changes that I was not involved in. I'm not sure how they recently setup the language subdomains, so I cannot help you with that.
I can tell you how the example polyglot website works. In fact, it's source code is included on this repo.
how do you build the home pages in different languages?
You are going to want to make multiple index.md
pages for each of your languages (index.es.md
, index.en.md
, ...) In the headers, set the correct lang for each page. I would guess that is the secret sauce to what you're missing.
Cheers, @untra
Thanks mate, I'll give it a try.
Right @untra,
I have one index.md for each language (index.es.md, index.en.md, index.pt.md), one layout > home.html for each language (home-en.html ... ) and one layout > default.html for each language (default-en.html ...)
I also have one of each _includes file for each language.
I discovered that if I change the language and layout of the index.md file, it changes the layout to the required language so the million dollars question is: What do I have to do in order to get the correct index.md file to be loaded when the corresponded language is selected by the user?
Once again, thanks for your help.
I just realised that the index page any language is compiled with the default language so this is clearly me not knowing how to setup correctly the languages in the _config.yml file.
This is more a question than an issue.
How would I localise the default layout in order to have my includes in different languages?
I managed to get my menu to dynamically sort the language with this liquid code:
but I wasn't able to get my default layout to pick the includes accordingly to the
site.active_language
any suggestion?Cheers