-
-
Notifications
You must be signed in to change notification settings - Fork 8.7k
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
Customize page title per plugin instance - avoid duplicated page title #5878
Comments
You can omit the export default function home() {
return (
// Don't add the title here
<Layout>
{/* ... */}
<Layout>
)
} And I do think there's something we can do: check if site title is equal to page title, and do not duplicate if that's the case: docusaurus/packages/docusaurus-theme-common/src/utils/generalUtils.ts Lines 12 to 14 in cbcaa52
|
@Josh-Cena , thank you! This change from defaults worked! 👍
Yes, that would be great! Additionally, it would be nice to have For example, I have two pages:
It would be nice to have instance name (i.e.
|
I propose this API to replace the current
It will leverage the existing Afaik, every page belongs to a plugin, so the |
@Josh-Cena , what about adding pluginTitle field? |
You mean... allowing each plugin instance to declare its own title component instead of relying on |
Using plugin instance name in site title is a quite specific need. In any case, I'd rather not apply this by default, and I think it's more a theming concern, not sure we want to add a nodejs plugin option just for this. React Helmet already has a The way I'd solve it:
Didn't test this but it should work. I'd rather use this because this is a marginal use-case and we already have/want APIs to support that |
Oh actually didn't even notice but we don't use
This is not a bad idea to have such a global themeConfig but the pluginId is not necessarily a good-looking label, and we can't easily make it good looking because it's used in many places like FS paths, not allowing all kind of chars. |
Another one: #7535 |
Would like to hear any updates on this! |
yeah same here (Not to NecroPost) |
Upvoted. Not entirely sure what the rationale was behind the decision to create these SEO values dynamically. You want to have full control as a website owner over this aspect. |
This would be superb. Would help to avoid swizzling layouts just to change the title format. |
Have you read the Contributing Guidelines on issues?
Prerequisites
npm run clear
oryarn clear
command.rm -rf node_modules yarn.lock package-lock.json
and re-installing packages.Description
By default, the landing page name repeats itself, i.e. "Auth with Caddy | Auth with Caddy".
Steps to reproduce
Please see the landing page of https://authp.github.io/
Expected behavior
The page name should not repeat, i.e. be "Auth with Caddy".
Actual behavior
The name repeats itself "Auth with Caddy | Auth with Caddy".
Your environment
2.0.0-beta.9
Reproducible demo
No response
Self-service
The text was updated successfully, but these errors were encountered: