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

refactor(www): Inherit guidelines layout from base layout #21350

Merged
merged 5 commits into from
Feb 12, 2020
Merged

refactor(www): Inherit guidelines layout from base layout #21350

merged 5 commits into from
Feb 12, 2020

Conversation

tesseralis
Copy link
Contributor

Description

Change guidelines/layout to compose with the normal layout used in the rest of the site for consistency.

@tesseralis tesseralis requested a review from fk February 10, 2020 21:23
@tesseralis tesseralis requested a review from a team as a code owner February 10, 2020 21:23
@tesseralis tesseralis changed the title Refactor (www): Inherit guidelines layout from base layout refactor(www): Inherit guidelines layout from base layout Feb 11, 2020
</title>
<meta name="twitter:site" content="@gatsbyjs" />
<meta name="og:type" content="website" />
<meta name="og:site_name" content="GatsbyJS" />
Copy link
Contributor

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:

<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.

Copy link
Contributor Author

@tesseralis tesseralis Feb 11, 2020

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.

Copy link
Contributor

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.

💯

Copy link
Contributor

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={{
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@blainekasten blainekasten self-assigned this Feb 11, 2020
Copy link
Contributor

@fk fk left a 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! 🙏 💜

www/src/components/guidelines/nav-item.js Outdated Show resolved Hide resolved
Co-Authored-By: Florian Kissling <21834+fk@users.noreply.github.com>
@tesseralis tesseralis assigned fk and unassigned blainekasten Feb 12, 2020
Copy link
Contributor

@fk fk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚡️ 🌮 🙏

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 this pull request may close these issues.

3 participants