File tree Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Expand file tree Collapse file tree 2 files changed +20
-5
lines changed Original file line number Diff line number Diff line change 11<script setup lang="ts">
2- import { useNuxtifyConfig , useServerSeoMeta } from ' #imports'
3-
42// App state
53const nuxtifyConfig = useNuxtifyConfig ()
64const dialog = useDialog ()
75const toast = useToast ()
86
97// Page info
8+ useNuxtifySiteTitle ()
109useServerSeoMeta ({
1110 title: ` ${nuxtifyConfig .brand ?.name } playground ` ,
1211 description: ` This is the ${nuxtifyConfig .brand ?.name } playground. ` ,
Original file line number Diff line number Diff line change 1- // Types
21import type { ModuleOptions } from '../../types'
3-
4- import { useAppConfig } from '#imports'
2+ import { useAppConfig , useHead } from '#imports'
53
64export const useNuxtifyConfig = ( ) : ModuleOptions => useAppConfig ( ) . nuxtify
5+
6+ export const useNuxtifySiteTitle = ( {
7+ separator = '|' ,
8+ siteName = '' ,
9+ } : { separator ?: string , siteName ?: string } = { } ) => {
10+ // App state
11+ const nuxtifyConfig = useNuxtifyConfig ( )
12+
13+ useHead ( {
14+ titleTemplate : ( titleChunk ) => {
15+ return titleChunk ? `${ titleChunk } %separator %siteName` : '%siteName'
16+ } ,
17+ templateParams : {
18+ siteName : siteName || nuxtifyConfig . brand ?. name ,
19+ separator,
20+ } ,
21+ } )
22+ }
You can’t perform that action at this time.
0 commit comments