From c0f788f3e25d468412e65e8c4930f4f2c71dd00c Mon Sep 17 00:00:00 2001 From: Robert Reinhard Date: Tue, 14 Nov 2023 16:55:41 -0800 Subject: [PATCH 1/2] Use relative reference to visual component --- adapters/globals/sanity-visual.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/adapters/globals/sanity-visual.js b/adapters/globals/sanity-visual.js index e3e72be..03e7a14 100644 --- a/adapters/globals/sanity-visual.js +++ b/adapters/globals/sanity-visual.js @@ -1,4 +1,4 @@ -import CloakVisual from '@cloak-app/visual/components/visual' +import CloakVisual from '../../components/visual' export default { functional: true, @@ -24,6 +24,9 @@ export default { props: { ...props, + // The provider should default Sanity + provider: props.provider || 'sanity', + // Pass along props that were extrapolated from Sanity objects image: getAssetRef(props.image), video: getVideoUrl(props.video), From e5112fc5f95942b13853804a6b15577b502509c3 Mon Sep 17 00:00:00 2001 From: Robert Reinhard Date: Tue, 14 Nov 2023 16:56:21 -0800 Subject: [PATCH 2/2] Adding Sanity example --- demo/content/demo.md | 38 ++++++++++++++++++++++++++++++++++++++ demo/nuxt.config.js | 6 ++++++ 2 files changed, 44 insertions(+) diff --git a/demo/content/demo.md b/demo/content/demo.md index 0dba844..a1d36f6 100644 --- a/demo/content/demo.md +++ b/demo/content/demo.md @@ -187,3 +187,41 @@ However, if multiple asssets are provided, a `` instance is re }]'> ``` + +## Sanity Visual + +Here's an example of the `` adapter. + + + + +```vue + + +``` diff --git a/demo/nuxt.config.js b/demo/nuxt.config.js index b1b3d43..64ae05e 100644 --- a/demo/nuxt.config.js +++ b/demo/nuxt.config.js @@ -26,6 +26,12 @@ export default { imgix: { baseURL: 'https://cloak-visual.imgix.net', }, + + // Creds from nuxt-sanity-demo + sanity: { + projectId: 'rnb0s8f2', + dataset: 'production', + } }, // @nuxt/content can't be loaded from module