@devite/nuxt-sanity 2.8.0 → 2.8.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defineNuxtModule, createResolver, addPlugin, addServerHandler, addImpor
|
|
|
3
3
|
import defu from 'defu';
|
|
4
4
|
|
|
5
5
|
const name = "@devite/nuxt-sanity";
|
|
6
|
-
const version = "2.8.
|
|
6
|
+
const version = "2.8.1";
|
|
7
7
|
|
|
8
8
|
const CONFIG_KEY = "sanity";
|
|
9
9
|
const module = defineNuxtModule({
|
|
@@ -135,11 +135,15 @@ const module = defineNuxtModule({
|
|
|
135
135
|
enabled: true,
|
|
136
136
|
studioUrl: moduleConfig.visualEditing.studioUrl
|
|
137
137
|
} || {},
|
|
138
|
-
visualEditing:
|
|
139
|
-
...moduleConfig.visualEditing,
|
|
140
|
-
token: void 0
|
|
141
|
-
}
|
|
138
|
+
visualEditing: moduleConfig.visualEditing
|
|
142
139
|
});
|
|
140
|
+
const publicSanityConfig = $config.public.sanity;
|
|
141
|
+
if (publicSanityConfig.visualEditing) {
|
|
142
|
+
delete publicSanityConfig.visualEditing.token;
|
|
143
|
+
}
|
|
144
|
+
if (publicSanityConfig.minimalClient && publicSanityConfig.minimalClient !== true) {
|
|
145
|
+
delete publicSanityConfig.minimalClient.webhookSecret;
|
|
146
|
+
}
|
|
143
147
|
addImportsDir(resolve("runtime/client"));
|
|
144
148
|
addImports(
|
|
145
149
|
[
|
|
@@ -48,16 +48,11 @@ const image: ComputedRef<ImageAsset | undefined> = computed(
|
|
|
48
48
|
)
|
|
49
49
|
const imageUrl = computed(() => image.value?.url)
|
|
50
50
|
const imageDimensions = computed(() => image.value?.metadata.dimensions)
|
|
51
|
+
const imageMimeType = computed(() => image.value?.mimeType as 'image/gif' | 'image/jpeg' | 'image/png' | undefined)
|
|
52
|
+
const imageAlt = computed(() => image.value?.altText as string | undefined)
|
|
51
53
|
|
|
52
54
|
useHead({
|
|
53
55
|
meta: [
|
|
54
|
-
{ name: 'site_name', content: () => globalSEO.value?.siteName },
|
|
55
|
-
{ name: 'og:image', content: () => imageUrl.value },
|
|
56
|
-
{ name: 'og:image:width', content: () => imageDimensions.value?.width },
|
|
57
|
-
{ name: 'og:image:height', content: () => imageDimensions.value?.height },
|
|
58
|
-
{ name: 'twitter:image', content: () => imageUrl.value },
|
|
59
|
-
{ name: 'twitter:image:width', content: () => imageDimensions.value?.width },
|
|
60
|
-
{ name: 'twitter:image:height', content: () => imageDimensions.value?.height },
|
|
61
56
|
{ name: 'og:url', content: () => url.value },
|
|
62
57
|
{ name: 'twitter:url', content: () => url.value },
|
|
63
58
|
],
|
|
@@ -65,12 +60,26 @@ useHead({
|
|
|
65
60
|
})
|
|
66
61
|
|
|
67
62
|
useSeoMeta({
|
|
63
|
+
// indexing
|
|
68
64
|
robots: () => `${seo.value?.indexable ? '' : 'no'}index,follow`,
|
|
65
|
+
// title
|
|
69
66
|
title: () => seo.value?.title || '',
|
|
70
|
-
description: () => seo.value?.description,
|
|
71
67
|
ogTitle: () => seo.value?.shortTitle,
|
|
72
|
-
ogDescription: () => seo.value?.description,
|
|
73
68
|
twitterTitle: () => seo.value?.shortTitle,
|
|
69
|
+
// description
|
|
70
|
+
description: () => seo.value?.description,
|
|
71
|
+
ogDescription: () => seo.value?.description,
|
|
74
72
|
twitterDescription: () => seo.value?.description,
|
|
73
|
+
// OpenGraph site name
|
|
74
|
+
ogSiteName: () => globalSEO.value?.siteName,
|
|
75
|
+
// OpenGraph Image
|
|
76
|
+
ogImage: () => imageUrl.value,
|
|
77
|
+
ogImageWidth: () => imageDimensions.value?.width,
|
|
78
|
+
ogImageHeight: () => imageDimensions.value?.height,
|
|
79
|
+
ogImageType: () => imageMimeType.value,
|
|
80
|
+
ogImageAlt: () => imageAlt.value,
|
|
81
|
+
// Twitter Image
|
|
82
|
+
twitterImage: () => imageUrl.value,
|
|
83
|
+
twitterImageAlt: () => imageAlt.value,
|
|
75
84
|
})
|
|
76
85
|
</script>
|