-
-
Notifications
You must be signed in to change notification settings - Fork 735
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: provide an Alternate language content links #6603
base: main
Are you sure you want to change the base?
Conversation
✅ Deploy Preview for plone-components canceled.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Just to make sure: is this also rendered server-side? In case it's not, do we need it to be rendered server-side? |
Er... I need to check this. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I think it should work on SSR too, but a confirmation would be great.
@erral don't worry about the test, Helmet
is basically a hack and has some caveats, but it should be fine.
@erral Can you check the failing multilingual cypress tests? |
<link | ||
key={key} | ||
rel="alternate" | ||
hreflang={item.language} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erral It does work on the SSR but I see this warning in client
Warning: Invalid DOM property `hreflang`. Did you mean `hrefLang`?
at link
at head
at html
at Html
if we use hrefLang, I think the browser will handle the conversion. On the server we get it as hrefLang
, does it cause issues in SEO ? I think the HTML attributes are case insensitive, the search engines should parse it as hreflang.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@erral It does work on the SSR but I see this warning in client
Warning: Invalid DOM property `hreflang`. Did you mean `hrefLang`? at link at head at html at Html
if we use hrefLang, I think the browser will handle the conversion. On the server we get it as
hrefLang
, does it cause issues in SEO ? I think the HTML attributes are case insensitive, the search engines should parse it as hreflang.
mmmm, this may be something similar to class
vs className
when rendering the react component.
I need to check this with SSR and the failing tests also, I will tackle this when I have some time later this week.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nileshgulia1 @erral HTML attributes are not case sensitive, but in React they are!
Yes, it is rendered in SSR! |
Closes #6602
Some comments:
I have found some issues on testing this, because the component injects the links to the Helmet, so I found here that I could use
Helmet.peek()
to get the current state of the Helmet in the tests and check there the links I inject.But it had a side-effect: as explained in the linked issue of react-helmet I found that between tests Helmet returns the previous state of the Helmet. So I reordered the tests in order to get them passing. I know that this is not the solution at all, but I haven't found any other test regarding the
Helmet
in the Volto codebase, so I don't know how to tackle this. Any help will be appreciated.