Cannot set `titleTemplate` as function
See original GitHub issueEnvironment
- Operating System:
Darwin
- Node Version:
v14.19.2
- Nuxt Version:
3.0.0-rc.3
- Package Manager:
yarn@1.22.18
- Builder:
vite
- User Config:
modules
,target
,app
,content
,css
,build
- Runtime Modules:
@nuxt/content-edge@2.0.0-27541979.40705ae
- Build Modules:
-
Reproduction
N/A
Describe the bug
Cannot set the titleTemplate
as a function (used for default titles when non existent).
Example:
import { defineNuxtConfig } from 'nuxt'
// https://v3.nuxtjs.org/api/configuration/nuxt.config
export default defineNuxtConfig({
app: {
head: {
titleTemplate: (titleChunk) => {
return titleChunk ? `${titleChunk} - Site Title` : 'Site Title';
},
}
}
})
Additional context
As far as I know, Nuxt 3 uses vue-meta, which the docs show it supports: https://vue-meta.nuxtjs.org/api/#titletemplate
Logs
No response
Issue Analytics
- State:
- Created a year ago
- Reactions:1
- Comments:5 (5 by maintainers)
Top Results From Across the Web
NuxtJS page title not change - Stack Overflow
Your nuxt.config.js override title set in your page. You should use titleTemplate in nuxt.config.js : head: { titleTemplate(titleChunk) ...
Read more >Create a title template in Motion - Apple Support
In Motion, the Final Cut Title template creates a custom title that can be applied to clips in the Final Cut Pro timeline....
Read more >dxPopup – How to keep the close button when using the title ...
Hi, Can you show me an example of keeping the X on the upper right of popup-title when adding a titleTemplate $("#popupContainer").dxPopu.
Read more >ContentDialog Class (Windows.UI.Xaml.Controls)
This example shows how to create a ContentDialog in the XAML of an app page. ... The TitleTemplate property is used to create...
Read more >3D title template error - magix.info
Hi and welcome to the user to user forums. I don't know if this is the same issue but about three Windows updates...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Like this: https://stackblitz.com/edit/github-d1ngrx?file=app.vue,plugins%2Ftitle.ts
Oh wow, that’s amazing thanks for providing an example, will look to PR this into the docs.