@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.
@@ -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 defaults: UseSeoMetaInput = {
14
- description: siteConfig.description,
15
- msapplicationConfig: `/assets/static/favicon/browserconfig.xml?v=${CACHE_VERSION}`,
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: toValue(title),
22
- }),
23
- ), // TODO: remove `ref`
24
- }
10
+ title: input.title.toString(),
11
+ })
12
+ : siteConfig.name
25
13
 
26
- useServerSeoMeta(defu(extension, defaults))
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dargmuesli/nuxt-vio",
3
- "version": "11.0.0-beta.2",
3
+ "version": "11.0.0-beta.3",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/dargmuesli/vio.git"
@@ -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 = ({