Skip to content

Commit

Permalink
Fix homepage title (#5838)
Browse files Browse the repository at this point in the history
* Fix homepage title

Fixed homepage title bug, now the homepage will display the title from `content/index.md` instead of the constant `React`.

* Update index.md

Change title to "React" to keep same
  • Loading branch information
daochouwangu authored Aug 7, 2023
1 parent a472775 commit cd13b52
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/components/Seo.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export const Seo = withRouter(
const canonicalUrl = `https://${siteDomain}${
router.asPath.split(/[\?\#]/)[0]
}`;
const pageTitle = isHomePage ? 'React' : title + ' – React';
const pageTitle = isHomePage ? title : title + ' – React';
// Twitter's meta parser is not very good.
const twitterTitle = pageTitle.replace(/[<>]/g, '');
return (
Expand Down
2 changes: 1 addition & 1 deletion src/content/index.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
---
id: home
title: React – The library for web and native user interfaces
title: React
permalink: index.html
---

Expand Down

0 comments on commit cd13b52

Please sign in to comment.