Open KajKandler opened 1 day ago
I have the following code in my [...slug].vue file in Nuxt Content to add page specific schema
<script setup> const route = useRoute() const { data: page } = await useAsyncData('content', () => queryContent(route.path).findOne()) // Extract schema from the content's frontmatter const schema = page.value.schema_org // Use the nuxt-schema-org composable to add schema if (schema !== undefined && schema != null) { useSchemaOrg(schema) } else { useSchemaOrg("") // produces empty element in the '@graph' list } </script>
produces this output
<script type="application/ld+json" id="schema-org-graph">{ "@context": "https://schema.org", "@graph": [ { // ... my global schema }, {} ] }</script>
No response
------------------------------ - Operating System: Darwin - Node Version: v21.7.1 - Nuxt Version: 3.13.2 - CLI Version: 3.14.0 - Nitro Version: 2.9.7 - Package Manager: npm@10.8.2 - Builder: - - User Config: - - Runtime Modules: - - Build Modules: - ------------------------------
Hi, what is the expected output when providing useSchemaOrg(""), it's not really clear?
useSchemaOrg("")
Describe the bug
I have the following code in my [...slug].vue file in Nuxt Content to add page specific schema
produces this output
Reproduction
No response
System / Nuxt Info