Skip to content

Conversation

@azu
Copy link

@azu azu commented Mar 15, 2023

This PR make <title> to "{pageTitle} | {siteConfig.title}" if pageTitle is defined.

Node.js
http://localhost:3000/en/

About | Node.js
http://localhost:3000/en/about/

Download | Node.js
http://localhost:3000/en/download/

Documentation | Node.js
http://localhost:3000/en/docs/

Get involved | Node.js
http://localhost:3000/en/get-involved/

Node.js
http://localhost:3000/en/blog/

Node v19.8.0 (Current) | Node.js
http://localhost:3000/en/blog/release/v19.8.0

fix #5141

// "{pageTitle} | {siteConfig.title}" if pageTitle is defined
const title =
// avoid "Node.js | Node.js" title
pageTitle && pageTitle !== siteConfig.title
Copy link
Author

Choose a reason for hiding this comment

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

📝 Some page's ${pageTitle} is "Node.js" and I avoid "Node.js | Node.js".

  • http://localhost:3000/en/: { pageTitle: 'Node.js', siteConfigTitle: 'Node.js' }
  • http://localhost:3000/en/blog/: { pageTitle: 'Node.js', siteConfigTitle: 'Node.js' }

Copy link
Member

Choose a reason for hiding this comment

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

I think this is extra logic. Only the pageTitle should be updated.

@azu
Copy link
Author

azu commented Mar 15, 2023

closed by #5143

@azu azu closed this Mar 15, 2023
@ovflowd
Copy link
Member

ovflowd commented Mar 15, 2023

@azu thank you anyways for the contribution! You beat me to it, but I appreciate anyways for your effort!

@azu azu deleted the fix-title branch March 16, 2023 02:43
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.

All page title is "<title>Node.js</title>"

2 participants