File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11<template >
22 <!-- Google Font -->
33 <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+
415 <ClientOnly >
516 <NuxtLoadingIndicator :color =" isDark ? '#C2C8EC' : '#2F45C7'" />
617 </ClientOnly >
@@ -27,31 +38,9 @@ const router = useRouter();
2738const { locale, availableLocales } = useI18n ();
2839const lang = ref (route .query .lang as string );
2940
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-
4041const head = useLocaleHead ({
4142 addDirAttribute: true ,
4243 identifierAttribute: " id" ,
4344 addSeoAttributes: true ,
4445});
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- });
5746 </script >
You can’t perform that action at this time.
0 commit comments