diff --git a/docs/content/docs/02.guide/06.seo.md b/docs/content/docs/02.guide/06.seo.md index 61e706c7c..1b5e9daa7 100644 --- a/docs/content/docs/02.guide/06.seo.md +++ b/docs/content/docs/02.guide/06.seo.md @@ -16,7 +16,9 @@ Here are the specific optimizations and features that it enables: ## Requirements -To leverage the SEO benefits, you must configure the `locales` option as an array of objects, where each object has an `language` option set to the locale language tags: +To leverage the SEO benefits, you must configure the `locales` option as an array of objects, where each object has an `language` option set to the locale language tags. + +**NOTE**: while `code` is used to create prefixes for URLs and to set locales and can be any arbitrary value, `language` goes to `` and must be [BCP 47](https://developer.mozilla.org/en-US/docs/Glossary/BCP_47_language_tag). In most cases though both can share the same value like `en` or `es`. ```ts [nuxt.config.ts] export default defineNuxtConfig({ @@ -24,7 +26,7 @@ export default defineNuxtConfig({ locales: [ { code: 'en', - language: 'en-US' + language: 'en' }, { code: 'es', @@ -61,7 +63,7 @@ The `useLocaleHead()`{lang="ts"} is a composable function, Calling that composab To enable SEO metadata, declare a `setup` function in one of the places specified above and make it return the result of a `useLocaleHead()`{lang="ts"} function call. -To avoid duplicating the code, it's recommended to set globally with [Meta Components](https://nuxt.com/docs/getting-started/seo-meta#components) in [layout components](https://nuxt.com/docs/guide/directory-structure/layouts) and override some values per-page Vue component like [`definePageMeta()`{lang="ts"}](https://nuxt.com/docs/guide/directory-structure/pages#page-metadata), if necessary. +To avoid duplicating the code, it's recommended to set globally with [Meta Components](https://nuxt.com/docs/getting-started/seo-meta#components) in `app.vue` or [layout components](https://nuxt.com/docs/guide/directory-structure/layouts) and override some values per-page Vue component like [`useSeoMeta()`{lang="ts"}](https://nuxt.com/docs/api/composables/use-seo-meta), if necessary. ::code-group @@ -71,44 +73,60 @@ To avoid duplicating the code, it's recommended to set globally with [Meta Compo + + ``` ```vue [layouts/default.vue] ``` ```vue [pages/index.vue]