File tree Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Expand file tree Collapse file tree 1 file changed +1
-2
lines changed Original file line number Diff line number Diff line change 1- //@ts -expect-error Node
21import fs from 'fs' ;
32import { mainLocale , baseUrl } from '../config' ;
43import type { SiteConfig } from 'vitepress' ;
@@ -31,7 +30,7 @@ export async function genI18nRedirector(siteConfig: SiteConfig) {
3130 ${ linkAlternate }
3231 <link rel="alternate" hreflang="x-default" href="${ baseUrl } /${ mainLocale } /${ routeForRender } ">
3332 <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>
3534</head>
3635<body>
3736 <noscript>${ fallbackLinks } </noscript>
You can’t perform that action at this time.
0 commit comments