Skip to content

Commit 7819862

Browse files
committed
docs: add description about tagPosition
1 parent c15241b commit 7819862

File tree

1 file changed

+21
-1
lines changed

1 file changed

+21
-1
lines changed

README.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default defineNuxtConfig({
3030
### Composition API
3131

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

3535
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).
3636
Of course, you can import explicitly from `#jsonld`.
@@ -60,6 +60,26 @@ useJsonld(() => ({
6060
</script>
6161
```
6262

63+
#### tagPosition
64+
65+
You can use the `tagPosition: 'bodyClose'` option on applicable tags to append them to the end of the `<body>` tag.
66+
This option works the same as the one described in [useHead](https://nuxt.com/docs/getting-started/seo-meta#body-tags).
67+
68+
default: `head`
69+
70+
```ts
71+
useJsonld(
72+
{
73+
'@context': 'https://schema.org',
74+
'@type': 'Thing',
75+
name: 'static json',
76+
},
77+
{
78+
tagPosition: 'bodyClose', // 'head', 'bodyOpen', 'bodyClose'
79+
}
80+
);
81+
```
82+
6383
### Options API
6484

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

0 commit comments

Comments
 (0)