react-helmet-async icon indicating copy to clipboard operation
react-helmet-async copied to clipboard

Link alternate are not unique

Open JPeer264 opened this issue 5 years ago • 0 comments

I am having a canonical and some alternates and different hrefLang. It seems that these stay not unique (repro). There is already a PR in the original react-helmet, but also not yet merged.

Input:

<Helmet>
	<link rel="canonical" href="https://www.xxx.com/subpath/" />
    <link rel="alternate" href="https://www.xxx.com/subpath/" hrefLang="en" />
    <link rel="alternate" href="https://www.xxx.com/subpath/" hrefLang="x-default" />
</Helmet>

<Helmet>
	<link rel="canonical" href="https://www.xxx.com/subpath/anotherpath/" />
    <link rel="alternate" href="https://www.xxx.com/subpath/anotherpath/" hrefLang="en" />
    <link rel="alternate" href="https://www.xxx.com/subpath/anotherpath/" hrefLang="x-default" />
</Helmet>

Output (first two are wrong and should not be here):

- <link rel="alternate" href="https://www.xxx.com/subpath/" hrefLang="en" />
- <link rel="alternate" href="https://www.xxx.com/subpath/" hrefLang="x-default" />
<link rel="canonical" href="https://www.xxx.com/subpath/anotherpath/" />
<link rel="alternate" href="https://www.xxx.com/subpath/anotherpath/" hrefLang="en" />
<link rel="alternate" href="https://www.xxx.com/subpath/anotherpath/" hrefLang="x-default" />

JPeer264 avatar Oct 14 '20 12:10 JPeer264