Skip to content

Commit 14d5884

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

File tree

1 file changed

+18
-1
lines changed

1 file changed

+18
-1
lines changed

README.md

Lines changed: 18 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,23 @@ 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+
'@context': 'https://schema.org',
73+
'@type': 'Thing',
74+
name: 'static json',
75+
}, {
76+
tagPosition: 'bodyClose', // 'head', 'bodyOpen', 'bodyClose'
77+
});
78+
```
79+
6380
### Options API
6481

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

0 commit comments

Comments
 (0)