Skip to content

Instantly share code, notes, and snippets.

@fmoessle
Created October 19, 2023 16:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fmoessle/82b6967716fec79123b477c75c790ecf to your computer and use it in GitHub Desktop.
Save fmoessle/82b6967716fec79123b477c75c790ecf to your computer and use it in GitHub Desktop.
component.vue
<script lang="ts" setup>
const jsonld = {
"@context": "https://schema.org",
"@type": "BreadcrumbList",
"itemListElement": [{
"@type": "ListItem",
"position": 1,
"name": "Books",
"item": "https://example.com/books"
}, {
"@type": "ListItem",
"position": 2,
"name": "The Lord of the Rings",
"item": "https://example.com/books/the-lord-of-the-rings"
}]
}
useHead({
script: [
{
hid: "breadcrumbs-json-ld",
type: "application/ld+json",
textContent: JSON.stringify(jsonld)
}
]
})
</script>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment