From d8aba2b02d99ecfd6d46d2a27fd1f987fb55db3f Mon Sep 17 00:00:00 2001 From: ymmooot Date: Thu, 28 Nov 2024 16:05:55 +0900 Subject: [PATCH] docs: add description about tagPosition --- README.md | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index fe1ab65f..4a22f244 100644 --- a/README.md +++ b/README.md @@ -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`. @@ -60,6 +60,23 @@ useJsonld(() => ({ ``` +#### tagPosition + +You can use the `tagPosition: 'bodyClose'` option on applicable tags to append them to the end of the `` 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.