-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
fix(v2): use site title if enabled blog-only mode #2259
Conversation
Deploy preview for docusaurus-2 ready! Built with commit da09d5b |
|
||
return ( | ||
<Layout title="Blog" description="Blog"> | ||
<Layout title={title} description="Blog"> |
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="Blog"
By the way, I’m not sure that it’s a good idea to specify a description for this page, since this is optional, and in its current form it is too short.
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.
Would it be better as Blog | ${title}
?
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.
I don’t think so, because it was assumed that the title would be completely its own without adding anything else.
@@ -48,7 +48,7 @@ function BlogTagsListPage(props) { | |||
.filter(item => item != null); | |||
|
|||
return ( | |||
<Layout title="Blog Tags" description="Blog Tags"> |
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.
What's wrong with Blog Tags here?
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.
I wanted to make the headline "more general", that it was suitable for both the regular using mode and the blog-only. This is all because on other blog pages it is difficult to determine if blog-only mode is enabled. I only had an idea with a global variable on my mind (via webpack), but I decided that I could reduce my efforts and slightly change the title 🤷♂️
Should I revert this change?
|
||
return ( | ||
<Layout title="Blog" description="Blog"> | ||
<Layout title={title} description="Blog"> |
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.
Would it be better as Blog | ${title}
?
const { | ||
siteConfig: {title: siteTitle}, | ||
} = useDocusaurusContext(); | ||
const isBlogOnlyMode = metadata.permalink === '/'; |
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.
I'm not sure about this. How does this work?
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.
I guess referencing the permalink
field wasn't intuitive to me
Motivation
Resolving of https://docusaurus.canny.io/admin/board/feature-requests/p/how-to-change-title-on-blog-only-mode (see also this comment)
When using Docusaurus as a blog-only mode, the title of the main page is just "Blog", although in this case it is expected to see the site title (specified in the config file).
In addition, as part of this PR, the title of other blog-related pages (tags lists and post tag pages) has been adjusted to make them more suitable for blog-only mode.
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
Enable blog-only mode and check meta titles.
Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)