In the Tell Google about localized versions of your page guide, I understand that I have to use hreflang for language or region-specific pages for the multi-regional and multilingual website I’m currently building.
Because some of my article will possibly apply to more than one country but using the same language (for example the same Article could be valid for canada/english and us/english), I think that the Sitemap way would be more simpler than the HTML tags way.
I’ve seen that you recently released gatsby-plugin-advanced-sitemap. The documentation on it doesn’t mention hreflang settings option. Does it support hreflang?
The plugin doesn’t currently support hreflang. As far as I understand it, hreflang is needed when you publish multiple versions of the same article or page, but in different languages.
What are the reasons for you to create two locales, even if they’re the same language?
The website i’m working on will be a product review website with Amazon affiliation. Sometimes, a product will only be available in one country or a subset of the country that I want to cover. For example, a product A can only be available in US but not in Canada so in this case, I will produce 2 English version of the same review, the US version will have the product A inside the review but not the Canadian version, who will only cover product available in Canada. Same goes for French Canadian content versus France content, they will both be in French but the product available are very different in Canada vs Europe.
Does this make sense? (Sorry for my English, this is not my first language)
I don’t think the advanced sitemap plugin will help you further atm. You will need to look into i18n plugins for Gatsby afaik. Here’s a good blog post about this: Building i18n with Gatsby | Gatsby
At the moment there’s no plan of building this into the advanced sitemap plugin, but we’re always happy to receive pull requests and assist getting features into the plugin!