Skip to content
Snippets Groups Projects

Draft: Implement @nuxt/content v3

Open Nathan Dubord requested to merge content-v3 into main
Compare and
33 files
+ 1513
9742
Compare changes
  • Side-by-side
  • Inline
Files
33
@@ -38,18 +38,20 @@ const props = defineProps<NextStepsProps>();
@@ -38,18 +38,20 @@ const props = defineProps<NextStepsProps>();
const { locale } = useI18n();
const { locale } = useI18n();
const { data } = await useAsyncData('next-steps', () =>
const { data } = await useAsyncData('next-steps', () =>
queryContent(`/shared/${locale.value.toLocaleLowerCase()}/next-steps`).findOne(),
queryCollection('shared').where('stem', '=', `shared/${locale.value}/next-steps`).first(),
);
);
 
const nextStepData = data?.value?.body;
 
if (!data) {
if (!data) {
throw new Error(`Error with NextSteps component content`);
throw new Error(`Error with NextSteps component content`);
}
}
const content = computed(() => ({
const content = computed(() => ({
header: props.header || data.value.header,
header: props.header || nextStepData.header,
blurb: props.blurb || data.value.blurb,
blurb: props.blurb || nextStepData.blurb,
button: props.button || data.value.button,
button: props.button || nextStepData.button,
secondaryButton: props.secondaryButton || data.value.secondaryButton,
secondaryButton: props.secondaryButton || nextStepData.secondaryButton,
}));
}));
const buttonHref = computed(() => updateFreeTrialGlmContent(content.value.button?.config.href || ''));
const buttonHref = computed(() => updateFreeTrialGlmContent(content.value.button?.config.href || ''));
Loading