Skip to content

Commit

Permalink
Remove meta description from most pages (#6392)
Browse files Browse the repository at this point in the history
Google uses this on many of our API doc pages and it's not a good snippet. Only put this on the homepage but leave the og:description and twitter:description.
  • Loading branch information
sophiebits authored Oct 27, 2023
1 parent 46b45fb commit b8acf01
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/components/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ function getDomain(languageCode: string): string {
export const Seo = withRouter(
({
title,
description = 'The library for web and native user interfaces',
image = '/images/og-default.png',
router,
children,
Expand All @@ -50,11 +49,15 @@ export const Seo = withRouter(
const pageTitle = isHomePage ? title : title + ' – React';
// Twitter's meta parser is not very good.
const twitterTitle = pageTitle.replace(/[<>]/g, '');
let description = isHomePage
? 'React is the library for web and native user interfaces. Build user interfaces out of individual pieces called components written in JavaScript. React is designed to let you seamlessly combine components written by independent people, teams, and organizations.'
: 'The library for web and native user interfaces';
return (
<Head>
<meta name="viewport" content="width=device-width, initial-scale=1" />
{title != null && <title key="title">{pageTitle}</title>}
{description != null && (
{isHomePage && (
// Let Google figure out a good description for each page.
<meta name="description" key="description" content={description} />
)}
<link rel="canonical" href={canonicalUrl} />
Expand Down

0 comments on commit b8acf01

Please sign in to comment.