Closed acocheo closed 10 months ago
Thank you for creating this issue.
I'll try to observe https://www.gatsbyjs.com/docs/reference/config-files/gatsby-config/#trailingslash and do it as configured for Gatsby.
Unfortunately there is no possibility to read the option from a plugin. I've introduced another option here: https://github.com/openscript-ch/gatsby-plugin-i18n-l10n/pull/187
Does this work for you?
Branch downloaded, compiled and tested in a project. It seems ok! All urls I can see (in hrefLang etc ) are correct TY! Waiting for release
I've released a new version. I hope everything works out. Thank you for raising this.
Hi again @openscript , sorry but we have noticed an issue during production build. It's about 404 page
ERROR UNKNOWN
Truncated page data information for the failed page "/it/404.html/": {
"errors": {},
"path": "/it/404.html/",
"slicesMap": {},
"pageContext": {
"locale": "it-IT",
"localePagesId": "404.html",
"translations": [
{
"locale": "en-GB",
"path": "/404.html/"
}
],
"prefix": "it"
}
}
failed Building static HTML for pages - 2.622s
Reading docs
https://www.gatsbyjs.com/docs/how-to/adding-common-features/add-404-page/
I see that the 404 page is compiled as 404.html
, so I think it's a special route where trailingSlash should not be used
(my guess)
Thanks for your help
By now this plugin doesn't use Gatsby
trailingSlash
option for URLs. Every time the plugin needs to build a path from scratch, it callstrimRightSlash
. For example hereExample
(Note: Gatsby automatically does a redirect to correct url, but wrong urls give troubles to SEO).
Consider that trailingSlash default is always.