File tree 1 file changed +1
-2
lines changed
1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change 1
- //@ts -expect-error Node
2
1
import fs from 'fs' ;
3
2
import { mainLocale , baseUrl } from '../config' ;
4
3
import type { SiteConfig } from 'vitepress' ;
@@ -31,7 +30,7 @@ export async function genI18nRedirector(siteConfig: SiteConfig) {
31
30
${ linkAlternate }
32
31
<link rel="alternate" hreflang="x-default" href="${ baseUrl } /${ mainLocale } /${ routeForRender } ">
33
32
<link rel="canonical" href="${ baseUrl } /${ mainLocale } /${ routeForRender } ">
34
- <script type="text/javascript">const s = ${ JSON . stringify ( localeNames ) } ; const d = localStorage.getItem('ais:locale'); if (d) { location.replace('/' + d + location.pathname + location.search); } else if (s.includes(navigator.language.split("-")[0])) { location.replace('/' + navigator.language.split("-")[0] + location.pathname + location.search); } else { location.replace('/ja' + location.pathname + location.search); }</script>
33
+ <script type="text/javascript">const s = ${ JSON . stringify ( localeNames ) } ; const d = localStorage.getItem('ais:locale'); if (d) { location.replace('/' + d + location.pathname + location.search + location.hash ); } else if (s.includes(navigator.language.split("-")[0])) { location.replace('/' + navigator.language.split("-")[0] + location.pathname + location.search + location.hash ); } else { location.replace('/ja' + location.pathname + location.search + location.hash ); }</script>
35
34
</head>
36
35
<body>
37
36
<noscript>${ fallbackLinks } </noscript>
You can’t perform that action at this time.
0 commit comments