diff --git a/docs/content/docs/5.v9/2.guide/19.breaking-changes-in-v9.md b/docs/content/docs/5.v9/2.guide/19.breaking-changes-in-v9.md index 7c558a050..d2caa3c91 100644 --- a/docs/content/docs/5.v9/2.guide/19.breaking-changes-in-v9.md +++ b/docs/content/docs/5.v9/2.guide/19.breaking-changes-in-v9.md @@ -63,7 +63,21 @@ Some properties have changed or swapped names to better fit their functionality, ## SEO - `useLocaleHead` -We have added a `addLangAttribute` property to the options parameter of `useLocaleHead` and `$localeHead`, originally this was not configurable on its own. If you want to keep the same behavior, if you were passing `addSeoAttributes`, you will also have to pass `addLangAttribute: true`. See [`useLocaleHead`](/docs/v9/api#useLocaleHead) +The options parameter for `useLocaleHead` and `$localeHead` as changed in shape, having less verbose property names, as well as enabling the options by default. + +This table compares the option properties of `useLocaleHead` and `$localeHead for v8 and v9: + +| v8 | v9 | Notes | +| --- | --- | --- | +| `-` | `lang` | New property to configure the `lang` html attributes, default: `true` | +| `addDirAttributes` | `dir` | Default changed: `false` -> `true` | +| `addSeoAttributes` | `seo` | Default changed: `false` -> `true` | +| `identifierAttribute` | `key` | | + +We have added a `lang` property to the options parameter of `useLocaleHead` and `$localeHead`, originally this was not configurable on its own, see [`useLocaleHead`](/docs/v9/api#useLocaleHead) for details on its usage. + + + ## Nuxt context functions diff --git a/docs/content/docs/5.v9/2.guide/6.seo.md b/docs/content/docs/5.v9/2.guide/6.seo.md index 7a4e5a50d..2fc09884c 100644 --- a/docs/content/docs/5.v9/2.guide/6.seo.md +++ b/docs/content/docs/5.v9/2.guide/6.seo.md @@ -77,12 +77,7 @@ To avoid duplicating the code, it's recommended to set globally with [Meta Compo diff --git a/docs/content/docs/5.v9/4.api/1.index.md b/docs/content/docs/5.v9/4.api/1.index.md index d3547d261..e713a8b50 100644 --- a/docs/content/docs/5.v9/4.api/1.index.md +++ b/docs/content/docs/5.v9/4.api/1.index.md @@ -88,7 +88,7 @@ Example: ```vue diff --git a/specs/fixtures/basic_usage/pages/composables.vue b/specs/fixtures/basic_usage/pages/composables.vue index be42687e7..a337e5881 100644 --- a/specs/fixtures/basic_usage/pages/composables.vue +++ b/specs/fixtures/basic_usage/pages/composables.vue @@ -6,7 +6,7 @@ const localePath = useLocalePath() const localeRoute = useLocaleRoute() const switchLocalePath = useSwitchLocalePath() const routeBaseName = useRouteBaseName() -const localeHead = useLocaleHead({ addDirAttribute: true, addSeoAttributes: true, identifierAttribute: 'id' }) +const localeHead = useLocaleHead({ key: 'id' }) const metaTestEntries = computed(() => [ { id: 'locale-path', content: localePath('/nested/test-route') }, diff --git a/specs/fixtures/basic_usage/pages/index.vue b/specs/fixtures/basic_usage/pages/index.vue index 09f439f4e..7cb62b3a4 100644 --- a/specs/fixtures/basic_usage/pages/index.vue +++ b/specs/fixtures/basic_usage/pages/index.vue @@ -7,7 +7,6 @@ import { useAppConfig, useAsyncData, useHead, - useNuxtApp, useRoute, useRuntimeConfig, watch @@ -62,12 +61,7 @@ definePageMeta({ alias: ['/aliased-home-path'] }) -const i18nHead = useLocaleHead({ - addDirAttribute: true, - addLangAttribute: true, - identifierAttribute: 'id', - addSeoAttributes: { canonicalQueries: ['page'] } -}) +const i18nHead = useLocaleHead({ key: 'id', seo: { canonicalQueries: ['page'] } }) useHead({ htmlAttrs: { lang: i18nHead.value.htmlAttrs!.lang diff --git a/specs/fixtures/basic_usage/pages/nuxt-context-extension.vue b/specs/fixtures/basic_usage/pages/nuxt-context-extension.vue index 2e03bdb5f..a3e9a1aa8 100644 --- a/specs/fixtures/basic_usage/pages/nuxt-context-extension.vue +++ b/specs/fixtures/basic_usage/pages/nuxt-context-extension.vue @@ -6,6 +6,6 @@

{{ $nuxt.$switchLocalePath('ja') }}

{{ $nuxt.$localePath('nuxt-context-extension', 'nl') }}

{{ JSON.stringify($nuxt.$localeRoute()) }}

-

{{ $nuxt.$localeHead({ addLangAttribute: true }) }}

+

{{ $nuxt.$localeHead({ dir: false }) }}

diff --git a/specs/fixtures/different_domains/pages/index.vue b/specs/fixtures/different_domains/pages/index.vue index b2c625ac2..5f68f6f23 100644 --- a/specs/fixtures/different_domains/pages/index.vue +++ b/specs/fixtures/different_domains/pages/index.vue @@ -1,18 +1,13 @@