File tree 1 file changed +11
-22
lines changed
1 file changed +11
-22
lines changed Original file line number Diff line number Diff line change 1
1
<template >
2
2
<!-- Google Font -->
3
3
<Html :lang =" head.htmlAttrs.lang" :dir =" head.htmlAttrs.dir" >
4
+ <Head >
5
+ <template v-for =" link in head .link " :key =" link .hid " >
6
+ <Link
7
+ :id =" link.hid"
8
+ :rel =" link.rel"
9
+ :href =" link.href"
10
+ :hreflang =" link.hreflang"
11
+ />
12
+ </template >
13
+ </Head >
14
+
4
15
<ClientOnly >
5
16
<NuxtLoadingIndicator :color =" isDark ? '#C2C8EC' : '#2F45C7'" />
6
17
</ClientOnly >
@@ -27,31 +38,9 @@ const router = useRouter();
27
38
const { locale, availableLocales } = useI18n ();
28
39
const lang = ref (route .query .lang as string );
29
40
30
- // check if lang query param is valid
31
- if (lang .value && availableLocales .includes (lang .value )) {
32
- locale .value = lang .value ;
33
-
34
- // remove lang query param from url
35
- const newQuery = { ... route .query };
36
- delete newQuery .lang ;
37
- router .replace ({ query: newQuery });
38
- }
39
-
40
41
const head = useLocaleHead ({
41
42
addDirAttribute: true ,
42
43
identifierAttribute: " id" ,
43
44
addSeoAttributes: true ,
44
45
});
45
-
46
- onMounted (() => {
47
- const links = availableLocales .map ((l ) => ({
48
- rel: " alternate" ,
49
- hreflang: l ,
50
- href: ` http://bluescript.app${route .fullPath .split (" ?" )[0 ]}?lang=${l } ` ,
51
- }));
52
-
53
- useHead ({
54
- link: links ,
55
- });
56
- });
57
46
</script >
You can’t perform that action at this time.
0 commit comments