-
Notifications
You must be signed in to change notification settings - Fork 10.3k
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
refactor(www): Inherit guidelines layout from base layout #21350
Conversation
</title> | ||
<meta name="twitter:site" content="@gatsbyjs" /> | ||
<meta name="og:type" content="website" /> | ||
<meta name="og:site_name" content="GatsbyJS" /> |
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.
Not sure if this matters, but there is some functional changes in these meta tags that are rendered in the BaseLayout:
gatsby/www/src/components/site-metadata.js
Lines 28 to 43 in b7d34ed
<meta name="docsearch:version" content="2.0" /> | |
<meta | |
name="viewport" | |
content="width=device-width,initial-scale=1,shrink-to-fit=no,viewport-fit=cover" | |
/> | |
<meta property="og:url" content={siteUrl} /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:locale" content={locale} /> | |
<meta property="og:site_name" content={title} /> | |
<meta property="og:image" content={`${siteUrl}${gatsbyIcon}`} /> | |
<meta property="og:image:width" content="512" /> | |
<meta property="og:image:height" content="512" /> | |
<meta name="twitter:card" content="summary" /> | |
<meta name="twitter:site" content={twitter} /> |
things that popped out at me is og:site_name is different, the twitter:site is missing, the output will have 2 title fields? unless Helmet resolves them. But you are passing helmet a defaultTitle from the site metadata, but then rendering a title here. I'm not sure what get's priority or how that resolves.
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.
- Helmet overrides the title fields with the most specific one. The
defaultTitle
is only shown when <title> isn't defined in a child component og:site_name
resolves to the siteMetadata.title field defined in Gatsby config, which is... GatsbyJS, same as this one.
My interpretation is that these fields were copied over from the base Layout (and thus SiteMetadata) when this page was created, and hard-coded because we didn't want to query siteMetadata here. My guess is that twitter:site
was added after this page was created, and it wasn't copied over. Having everything use the same site layout makes sure everything is consistent going forward.
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.
Having everything use the same site layout makes sure everything is consistent going forward.
💯
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.
My interpretation is that these fields were copied over from the base Layout (and thus SiteMetadata) when this page was created, and hard-coded because we didn't want to query siteMetadata here. My guess is that twitter:site was added after this page was created, and it wasn't copied over.
I honestly can't remember anymore 😓
<Box | ||
bg="background" | ||
position="relative" | ||
sx={{ |
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.
why is sx
no longer needed?
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.
This sx
pushes content down to account for the banner and the nav-bar. But this is already done by the base Layout
, meaning that keeping this will cause content to be pushed down even further.
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.
This looks great @tesseralis!
Thank you so much for all your work! 🙏 💜
Co-Authored-By: Florian Kissling <21834+fk@users.noreply.github.com>
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.
⚡️ 🌮 🙏
Description
Change guidelines/layout to compose with the normal layout used in the rest of the site for consistency.