@dargmuesli/nuxt-vio 11.0.0-beta.2 → 11.0.0-beta.3
Sign up to get free protection for your applications and to get access to all the features.
- package/composables/useHeadDefault.ts +19 -20
- package/package.json +1 -1
- package/utils/constants.ts +1 -1
@@ -1,27 +1,26 @@
|
|
1
|
-
import { defu } from 'defu'
|
2
1
|
import type { UseSeoMetaInput } from '@unhead/vue'
|
3
2
|
|
4
|
-
export const useHeadDefault = ({
|
5
|
-
extension,
|
6
|
-
title,
|
7
|
-
}: {
|
8
|
-
extension?: UseSeoMetaInput
|
9
|
-
title: string | ComputedRef<string>
|
10
|
-
}) => {
|
3
|
+
export const useHeadDefault = (input: UseSeoMetaInput) => {
|
11
4
|
const siteConfig = useSiteConfig()
|
12
5
|
|
13
|
-
const
|
14
|
-
|
15
|
-
|
16
|
-
title,
|
17
|
-
twitterDescription: siteConfig.description,
|
18
|
-
twitterTitle: ref(
|
19
|
-
TITLE_TEMPLATE({
|
6
|
+
const description = input.description || siteConfig.description // TODO: remove site configuration fallback (https://github.com/harlan-zw/nuxt-site-config/issues/26)
|
7
|
+
const title = input.title
|
8
|
+
? TITLE_TEMPLATE({
|
20
9
|
siteName: siteConfig.name,
|
21
|
-
title:
|
22
|
-
})
|
23
|
-
|
24
|
-
}
|
10
|
+
title: input.title.toString(),
|
11
|
+
})
|
12
|
+
: siteConfig.name
|
25
13
|
|
26
|
-
useServerSeoMeta(
|
14
|
+
useServerSeoMeta({
|
15
|
+
...(description
|
16
|
+
? {
|
17
|
+
description,
|
18
|
+
ogDescription: description,
|
19
|
+
twitterDescription: siteConfig.description,
|
20
|
+
}
|
21
|
+
: {}),
|
22
|
+
msapplicationConfig: `/assets/static/favicon/browserconfig.xml?v=${CACHE_VERSION}`,
|
23
|
+
...(title ? { title, ogTitle: title, twitterTitle: title } : {}),
|
24
|
+
...input,
|
25
|
+
})
|
27
26
|
}
|
package/package.json
CHANGED
package/utils/constants.ts
CHANGED
@@ -49,7 +49,7 @@ export const TITLE_TEMPLATE = ({
|
|
49
49
|
title,
|
50
50
|
}: {
|
51
51
|
siteName: string
|
52
|
-
title?: string
|
52
|
+
title?: string | null
|
53
53
|
}) => (title && title !== siteName ? `${title} · ${siteName}` : siteName)
|
54
54
|
export const VERIFICATION_FORMAT_UUID = helpers.regex(REGEX_UUID)
|
55
55
|
export const VIO_NUXT_BASE_CONFIG = ({
|