fix(theme): add `rel="alternate"` and `hreflang` to links in language menu (#5108)

pull/4813/merge
Tatsunori Uchino 3 months ago committed by GitHub
parent a01bba0cad
commit f09593b073
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

@ -7,6 +7,7 @@ import VPLink from './VPLink.vue'
const props = defineProps<{
item: T
rel?: string
}>()
const { page } = useData()
@ -33,7 +34,7 @@ defineOptions({ inheritAttrs: false })
}"
:href
:target="item.target"
:rel="item.rel"
:rel="props.rel ?? item.rel"
:no-icon="item.noIcon"
>
<span v-html="item.text"></span>

@ -31,7 +31,13 @@ const hasExtraContent = computed(
<p class="trans-title">{{ currentLang.label }}</p>
<template v-for="locale in localeLinks" :key="locale.link">
<VPMenuLink :item="locale" :lang="locale.lang" :dir="locale.dir" />
<VPMenuLink
:item="locale"
:lang="locale.lang"
:hreflang="locale.lang"
rel="alternate"
:dir="locale.dir"
/>
</template>
</div>

@ -19,7 +19,13 @@ const { localeLinks, currentLang } = useLangs({ correspondingLink: true })
<p class="title">{{ currentLang.label }}</p>
<template v-for="locale in localeLinks" :key="locale.link">
<VPMenuLink :item="locale" :lang="locale.lang" :dir="locale.dir" />
<VPMenuLink
:item="locale"
:lang="locale.lang"
:hreflang="locale.lang"
rel="alternate"
:dir="locale.dir"
/>
</template>
</div>
</VPFlyout>

Loading…
Cancel
Save