Skip to content

Commit ab8192c

Browse files
committed
refactor: use AppCredits and useNuxtifySiteTitle from core
1 parent 14403c0 commit ab8192c

File tree

3 files changed

+11
-66
lines changed

3 files changed

+11
-66
lines changed

playground/nuxt.config.ts

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,5 +93,15 @@ export default defineNuxtConfig({
9393
},
9494
],
9595
},
96+
97+
// Credits
98+
credits: {
99+
creator: {
100+
name: 'Nuxtify',
101+
domain: 'nuxtify.dev',
102+
},
103+
prependText: 'Made with love by',
104+
appendText: ' Ship weirdly fast.',
105+
},
96106
},
97107
})

src/runtime/components/app/AppCredits.vue

Lines changed: 0 additions & 47 deletions
This file was deleted.

src/runtime/composables/nuxtify.ts

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,4 @@
11
import type { ModuleOptions } from '../../types/module'
2-
import { useAppConfig, useHead } from '#imports'
2+
import { useAppConfig } from '#imports'
33

44
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-
}

0 commit comments

Comments
 (0)