Skip to content

Commit

Permalink
docs: add description about tagPosition
Browse files Browse the repository at this point in the history
  • Loading branch information
ymmooot committed Nov 28, 2024
1 parent c15241b commit 7819862
Showing 1 changed file with 21 additions and 1 deletion.
22 changes: 21 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ export default defineNuxtConfig({
### Composition API

You can call `useJsonld` with a json object.
Alternatively, you can pass a function for a reactive json, just as [`useHead`](https://v3.nuxtjs.org/guide/features/head-management/#usehead-composable) composable.
Alternatively, you can pass a function for a reactive json.

You can use `useJsonld` without importing, since it is provided as [Nuxt auto-imports functions](https://v3.nuxtjs.org/guide/concepts/auto-imports#nuxt-auto-imports).
Of course, you can import explicitly from `#jsonld`.
Expand Down Expand Up @@ -60,6 +60,26 @@ useJsonld(() => ({
</script>
```

#### tagPosition

You can use the `tagPosition: 'bodyClose'` option on applicable tags to append them to the end of the `<body>` tag.
This option works the same as the one described in [useHead](https://nuxt.com/docs/getting-started/seo-meta#body-tags).

default: `head`

```ts
useJsonld(
{
'@context': 'https://schema.org',
'@type': 'Thing',
name: 'static json',
},
{
tagPosition: 'bodyClose', // 'head', 'bodyOpen', 'bodyClose'
}
);
```

### Options API

Make a jsonld method to your Vue components and return structured data object.
Expand Down

0 comments on commit 7819862

Please sign in to comment.