@devite/nuxt-sanity 2.12.1 → 2.12.2

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.12.1",
3
+ "version": "2.12.2",
4
4
  "configKey": "sanity",
5
5
  "builder": {
6
6
  "@nuxt/module-builder": "1.0.1",
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.12.1";
6
+ const version = "2.12.2";
7
7
 
8
8
  const CONFIG_KEY = "sanity";
9
9
  const module = defineNuxtModule({
@@ -16,7 +16,7 @@ import { groq, IMAGE_WITHOUT_PREVIEW_PROJECTION, useRequestEvent, useRoute, useR
16
16
  const path = useRoute().path;
17
17
  const groqFilter = path === "/" ? '_type == "home"' : `_type == "page" && slug.current == $slug`;
18
18
  const { data: sanityData } = await useSanityQuery(
19
- groq`*[(${groqFilter}) || _type == "notFound"][0] { _id, _type, title, modules, seo { _type, indexable, title, shortTitle, description, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} } }`,
19
+ groq`*[(${groqFilter}) || _type == "notFound"][0] { _id, _type, slug, title, modules, seo { _type, indexable, title, shortTitle, description, image ${IMAGE_WITHOUT_PREVIEW_PROJECTION} } }`,
20
20
  { slug: path.substring(1) }
21
21
  );
22
22
  if (sanityData.value?._type === "notFound" && import.meta.server) {
@@ -27,7 +27,7 @@ if (sanityData.value?._type === "notFound" && import.meta.server) {
27
27
  const { baseUrl } = useRuntimeConfig().public;
28
28
  const seo = computed(() => sanityData.value?.seo);
29
29
  useSanitySEO(
30
- (baseUrl || "") + (sanityData.value && ("slug" in sanityData.value ? sanityData.value.slug.current : null) || "/"),
30
+ (baseUrl || "") + "/" + (sanityData.value && "slug" in sanityData.value && sanityData.value.slug?.current ? sanityData.value.slug.current : ""),
31
31
  seo
32
32
  );
33
33
  </script>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devite/nuxt-sanity",
3
- "version": "2.12.1",
3
+ "version": "2.12.2",
4
4
  "description": "Advanced Sanity integration for Nuxt.js.",
5
5
  "repository": "devite-io/nuxt-sanity",
6
6
  "license": "MIT",