guides
Learn how to set a title template for your site.
Title templates allow you to render your page titles in a uniform way.
titleTemplate
Using the titleTemplate
key allows you to set a template for your page titles.
Title template can either be:
%s
, that is replaced with the title
useHead({
titleTemplate: 'My Site - %s',
})
useHead({
titleTemplate: (title?: string) => `${title} - My Site`,
})
If you want to disable the title template for a specific page, you can set titleTemplate
to null
.
useHead({
titleTemplate: null,
})
useHead({
titleTemplate: (title?: string) => !title ? 'Default title' : `${title} - My Site`,
})