I wondered whether landing on my website and choosing a language (in my case IT or EN) the user can see - for example - the home page in Italian as different from the English one.
I wondered whether it is possible to have a home page in Italian and another one in English.
What exactly do you mean by that? You HAVE a home page in IT and one in EN, but I guess what you mean is not the homepage (in sense of the start page of that language) but some form of hosting your site on two domains with one being IT and one being EN? Or having IT visitors being redirected to the IT home page and all others to the EN page?
Maybe add a more verbose example of your requirements…
Hint: If languages have their own permalinks they will create language-based sites in their respective folders.
Thank you,
Your example is for two different domains.
Please, see https://www.nicfab.it
You see that the home page is the same for IT and EN (apart from the posts).
Is it possible to have different home page content (the home page IT with Italian content and the home page EN only with English content)?
That depends on your hosting situation. Typically you add some headers to your system that tell browsers where to go depending on the language of the visitor.
Please see my previous comment.
Your repository is incomplete.
When I do this:
git clone --recurse-submodules https://github.com/nicfab/myhu
cd myhu
hugo
I get this:
WARN 2022/01/14 08:45:51 found no layout file for “HTML” for layout “rss” for kind “page”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
WARN 2022/01/14 08:45:51 found no layout file for “HTML” for kind “page”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
…
…
…
WARN 2022/01/14 08:45:51 found no layout file for “JSON” for kind “home”: You should create a template file which matches Hugo Layouts Lookup Rules for this combination.
As a courtesy to those who are trying to help you, please make sure your site builds.
Hmm, can you list the URL format you wish to achieve? Something like this:
https://domain.tld/en/
https://domain.tld/it/
Because when I visit https://www.nicfab.it I am redirected to: https://www.nicfab.it/en/. And if I click the Italian language, I am redirected to https://www.nicfab.it/it/. Both of which, /en/ and /it/ are only showing the content/posts for that particular language.
So, the above is confusing because your current build is working as intended – separate homepages for English and Italian content/posts. (I only see English content/posts in /en/ and only Italian content/posts in /it/.)
Is what you’re asking different themes for /en/ and /it/?
Or, are you talking about the “Welcome to our blog” section? What you want is for the English translation to only show in /en/ and the Italian translation “Benvenuto sul nostro Blog” to only show in /it/?
@jmooring Thank you very much. I much appreciate it.
I am a lawyer passionate about informatics, and I am not a developer; so, apologies for some of my interventions are not entirely accurate.
Now the architecture of my sites is better.
I understand that I can write inside the file _index.md, which is under content/en or content/it and any additional content is added to the home page.
Moreover, I understand that the central part of the home page (https://www.nicfab.it - where is the disclaimer) depends on the theme used, and it’s impossible to differentiate.