gatsbyjs / themes

This is a repo for Gatsby's official themes.
138 stars 77 forks source link

gatsby-theme-i18n adds trailing slash even if trailingSlash is set to never #169

Open gugu opened 2 years ago

gugu commented 2 years ago

Expected behaviour for location / and trailingSlash=never:

<link data-react-helmet="true" rel="alternate" hrefLang="x-default" href="https://short.io/"/>
<link data-react-helmet="true" rel="alternate" hrefLang="ru" href="https://short.io/zh"/> <!-- current -->
<link data-react-helmet="true" rel="alternate" hrefLang="en-US" href="https://short.io/"/>
<link data-react-helmet="true" rel="alternate" hrefLang="ja" href="https://short.io/ja"/>
<link data-react-helmet="true" rel="alternate" hrefLang="de" href="https://short.io/de"/>

current behaviour:

<link data-react-helmet="true" rel="alternate" hrefLang="x-default" href="https://short.io/"/>
<link data-react-helmet="true" rel="alternate" hrefLang="ru" href="https://short.io/zh"/> <!-- current -->
<link data-react-helmet="true" rel="alternate" hrefLang="en-US" href="https://short.io/"/>
<link data-react-helmet="true" rel="alternate" hrefLang="ja" href="https://short.io/ja/"/> <!-- extra slash -->
<link data-react-helmet="true" rel="alternate" hrefLang="de" href="https://short.io/de/"/> <!-- extra slash -->
...