-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
[docs] Automatic title and meta description #863
Conversation
vladmoroz
commented
Nov 25, 2024
- I have followed (at least) the PR section of the contributing guide.
Netlify deploy preview |
h1: (props) => ( | ||
<React.Fragment> | ||
<h1 className="mb-4 text-3xl font-bold" {...props} /> | ||
<title>{`${getChildrenText(props.children)} · Base UI`}</title> |
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.
AFAIR, we wanted to have a richer title than just the title for SEO purposes ("React Dialog component" instead of just "Dialog")
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.
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.
I agree. It does look better in the browser's tabs.
@oliviertassinari, I remember you were suggesting richer titles in the past. Any opinions on 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.
We can put the SEO juice in the url
url: /react-component-name
pageTitle: Component name • Base UI
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.
We've agreed on the following for titles and URLs:
Dialog • Base UI
https://base-ui.com/react/dialog
Bonus, URLs are going to match import paths:
// When we do kebab-casing
import { Dialog } from "@base-ui-components/react/dialog"
// Eventually
import { Dialog } from "@base-ui/react/dialog"
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.
I remember you were suggesting richer titles in the past. Any opinions on this?
@michaldudak Right, so why do the pages of MUI follow those patterns?
- On the SEO side, if we can trust Moz.com (account), it's a ranking factor. Because
- On the UX side, we could change the title after the page is rendered? Google still renders pages in JS, so the solution might be to detect multiple tabs: https://stackoverflow.com/questions/9576851/detect-presence-of-other-tabs-windows-of-same-domain. If there are multiple tabs, we can use the short titles, Google won't see them. UX is improved, SEO is maximized.
Personally, I work with a small screen, my tabs are very quickly cut, I can't read them most of the time, I have learned to live without tab titles, so that's why I didn't bother so much. Or maybe it was because I always felt that onboarding is critical considering the duration developers stick to a specific stack. If someone helps win more new % users, and it's not annoying enough for them to leave, then it helps win in the long term?
We can wait to see how those pages rank. I will be curious to see. I'm creating an issue with this idea: mui/mui-public#251.
0e5163f
to
f62fa66
Compare
f62fa66
to
a67a57c
Compare