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
[Feature request] Allow us to Remove site name from page title #338
Labels
enhancement
New feature or request
Comments
This problem also exists in VuePress v1. I agree that we should provide a more flexible way to customize the content of |
What about providing a new client API to be called in For example: import {
defineClientAppEnhance,
setResolvePageHeadTitle,
} from '@vuepress/client'
export default defineClientAppEnhance(() => {
// this is the default behavior
setResolvePageHeadTitle(
(page, siteLocale) =>
`${page.title ? `${page.title} | ` : ``}${siteLocale.title}`
)
// users can customize this way
setResolvePageHeadTitle((page) => page.title)
}) |
It's not supported now, but you might modify it manually in import { defineClientAppSetup, usePageData } from '@vuepress/client'
import { nextTick } from 'vue'
import { useRouter } from 'vue-router'
export default defineClientAppSetup(() => {
const router = useRouter()
const page = usePageData()
const changeTitle = (): void => {
if (document) {
nextTick(() => {
document.title = page.value.title
})
}
}
changeTitle()
router.afterEach(() => changeTitle())
}) |
Can you please tell me location of this file after 1 hour I gave up. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to remove my site name from every page I don’t want it every where I just want page title
I want to remove the highlighted part in image It will be great if we can do some configuration in config file.
The text was updated successfully, but these errors were encountered: