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 1
1
<script setup lang="ts">
2
- import { useNuxtifyConfig , useServerSeoMeta } from ' #imports'
3
-
4
2
// App state
5
3
const nuxtifyConfig = useNuxtifyConfig ()
6
4
const dialog = useDialog ()
7
5
const toast = useToast ()
8
6
9
7
// Page info
8
+ useNuxtifySiteTitle ()
10
9
useServerSeoMeta ({
11
10
title: ` ${nuxtifyConfig .brand ?.name } playground ` ,
12
11
description: ` This is the ${nuxtifyConfig .brand ?.name } playground. ` ,
Original file line number Diff line number Diff line change 1
- // Types
2
1
import type { ModuleOptions } from '../../types'
3
-
4
- import { useAppConfig } from '#imports'
2
+ import { useAppConfig , useHead } from '#imports'
5
3
6
4
export 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