Skip to content
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

head meta tag during SSR #397

Closed
hi-ogawa opened this issue Jun 13, 2024 · 0 comments · Fixed by #449
Closed

head meta tag during SSR #397

hi-ogawa opened this issue Jun 13, 2024 · 0 comments · Fixed by #449

Comments

@hi-ogawa
Copy link
Owner

hi-ogawa commented Jun 13, 2024

Either introducing a whole export convention or maybe some helpers on top of React head float would be enough?

Assuming the need is mostly for SSR SEO, the issue is mostly due to naively using <title> will render duplicate tags.

// TODO: it doesn't magically overwrite already rendered title in the layout...
const res = await page.request.get("/test/head?title=hello");
const resText = await res.text();
expect(resText).toMatch(/<head>.*<title>rsc-experiment<\/title>.*<\/head>/s);
expect(resText).toMatch(/<head>.*<title>hello<\/title>.*<\/head>/s);

Something based on async context might be possible? (not possible to differentiate which page/layout render?)

@hi-ogawa hi-ogawa changed the title meta tag features meta tag and head for seo Jun 13, 2024
@hi-ogawa hi-ogawa changed the title meta tag and head for seo head meta tag for SEO Jun 13, 2024
@hi-ogawa hi-ogawa changed the title head meta tag for SEO head meta tag during SSR Jun 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant