nuxt-seomatic-meta
nuxt-seomatic-meta copied to clipboard
Multisite not working with language in path
Hi,
I'm experiencing an issue with the multisite logic.
I’m using nuxt-i18n to manage the languages of my application. For a same page in two different languages, the URLs are like the following:
- EN: https://www.mysite.com/my-page
- FR: https://www.mysite.com/fr/ma-page
The issue is that, when I do have a /fr
prefix in my route, that prefix is sent to SEOmatic via the uri
parameter (see screenshot below), and because of this SEOmatic cannot find the related entry. Craft does not include the language in the URIs of the pages. When I remove this prefix manually, it works.
![Screenshot 2020-04-02 at 10 19 17](https://user-images.githubusercontent.com/19463614/78228102-97f93c80-74ce-11ea-9704-a30599829f60.png)
This is what I did (in a simplified version) to make it work:
let fullPath = route.fullPath;
if (fullPath.startsWith('/fr')) {
fullPath = route.fullPath.replace('/fr/', '/');
}
return await app.seomaticMeta({ fullPath }, siteId);
I guess we can agree this is not a sustainable solution. Is there a way (with the current methods/configuration elements) to indicate to the plugin the languages to remove from the path for all the pages? Would it be possible to implement that feature otherwise?