Switch to en-US
This commit is contained in:
parent
e9d08bd263
commit
13c88b784a
@ -6,11 +6,11 @@ import mdshowSidebarJson from './i18n/sidebars/mdshow.json'
|
|||||||
import vitepressConfigJson from './i18n/vitepress-config.json'
|
import vitepressConfigJson from './i18n/vitepress-config.json'
|
||||||
import themeConfigJson from './i18n/theme-config.json'
|
import themeConfigJson from './i18n/theme-config.json'
|
||||||
|
|
||||||
type langType = 'zh-CN' | 'en-US'
|
type langType = 'en-US'
|
||||||
|
|
||||||
const getVitepressConfigLocales = (lang: langType = 'zh-CN') => (vitepressConfigJson[lang])
|
const getVitepressConfigLocales = (lang: langType = 'en-US') => (vitepressConfigJson[lang])
|
||||||
|
|
||||||
const getThemeConfigLocales = (lang: langType = 'zh-CN') => {
|
const getThemeConfigLocales = (lang: langType = 'en-US') => {
|
||||||
const sidebar = {}
|
const sidebar = {}
|
||||||
sidebar[`/${lang}/guide/`] = guideSidebarJson[lang]
|
sidebar[`/${lang}/guide/`] = guideSidebarJson[lang]
|
||||||
sidebar[`/${lang}/mdshow/`] = mdshowSidebarJson[lang]
|
sidebar[`/${lang}/mdshow/`] = mdshowSidebarJson[lang]
|
||||||
@ -33,9 +33,9 @@ const getLocales = (langs: langType[] = []) => {
|
|||||||
return config
|
return config
|
||||||
}
|
}
|
||||||
|
|
||||||
const getNav = (lang: 'zh-CN' | 'en-US' = 'zh-CN') => (navJson[lang])
|
const getNav = (lang: 'en-US' = 'en-US') => (navJson[lang])
|
||||||
|
|
||||||
const getSidebar = (lang: 'zh-CN' | 'en-US' = 'zh-CN') => ({
|
const getSidebar = (lang: 'en-US' = 'en-US') => ({
|
||||||
'/guide/': guideSidebarJson[lang],
|
'/guide/': guideSidebarJson[lang],
|
||||||
'/mdshow/': mdshowSidebarJson[lang]
|
'/mdshow/': mdshowSidebarJson[lang]
|
||||||
})
|
})
|
||||||
|
@ -11,7 +11,7 @@ export const useLang = () => {
|
|||||||
if (path?.includes('/')) {
|
if (path?.includes('/')) {
|
||||||
lang = path.split('/').shift()
|
lang = path.split('/').shift()
|
||||||
} else {
|
} else {
|
||||||
lang = 'zh-CN'
|
lang = 'en-US'
|
||||||
}
|
}
|
||||||
return lang
|
return lang
|
||||||
})
|
})
|
||||||
|
@ -18,15 +18,15 @@ hero:
|
|||||||
|
|
||||||
features:
|
features:
|
||||||
- title: 📦 Software Developer
|
- title: 📦 Software Developer
|
||||||
details: I have developed several libraries and tools used across many projects.
|
details: I have developed several libraries and tools used across many projects on Github.
|
||||||
- title: 🔩 Focused on Interconnectivity
|
- title: 🔩 Focused on Interconnectivity
|
||||||
details: I have a passion for applications that explore ways to spread information across the internet.
|
details: I have a passion for applications that explore ways to spread information across the internet.
|
||||||
- title: 🔑 Keybase Verification
|
- title: 🔑 Keybase Verification
|
||||||
details: You can find my Keybase verification [here](https://keybase.io/cclick).
|
details: You can find my Keybase verification at <a>https://keybase.io/cclick<a/>.
|
||||||
---
|
---
|
||||||
|
|
||||||
<div class="frontpage sponsors">
|
<div class="frontpage sponsors">
|
||||||
<h2>感 谢</h2>
|
<h2>Projects Used</h2>
|
||||||
<div class="platinum-sponsors">
|
<div class="platinum-sponsors">
|
||||||
<a v-for="{ href, src, name, id } of sponsors.filter(s => s.tier === 'platinum')" :href="href" target="_blank" rel="noopener" aria-label="sponsor-img">
|
<a v-for="{ href, src, name, id } of sponsors.filter(s => s.tier === 'platinum')" :href="href" target="_blank" rel="noopener" aria-label="sponsor-img">
|
||||||
<img :src="src" :alt="name" :id="`sponsor-${id}`">
|
<img :src="src" :alt="name" :id="`sponsor-${id}`">
|
||||||
@ -64,39 +64,15 @@ const sponsors = [
|
|||||||
"name": "Vitepress",
|
"name": "Vitepress",
|
||||||
"href": "https://vitepress.dev/",
|
"href": "https://vitepress.dev/",
|
||||||
"src": "https://vitepress.dev/vitepress-logo-mini.svg"
|
"src": "https://vitepress.dev/vitepress-logo-mini.svg"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"id": "vuetom",
|
||||||
|
"name": "Vitepress Vuetom Theme",
|
||||||
|
"href": "https://github.com/vuetom/vitepress-theme-vuetom",
|
||||||
|
"src": "https://raw.githubusercontent.com/vuetom/vitepress-theme-vuetom/refs/heads/main/packages/docs/public/logo/vuetom-logo-s.png"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
||||||
function fetchReleaseTag() {
|
|
||||||
onMounted(() => {
|
|
||||||
const dom = document.getElementsByClassName('name')
|
|
||||||
const mainTitle = dom[0]
|
|
||||||
const docsReleaseTag = document.createElement('span')
|
|
||||||
docsReleaseTag.classList.add('release-tag')
|
|
||||||
const releaseTagName = `v${pk.version}`
|
|
||||||
docsReleaseTag.innerText = releaseTagName
|
|
||||||
if (releaseTagName !== undefined) {
|
|
||||||
mainTitle.appendChild(docsReleaseTag)
|
|
||||||
}
|
|
||||||
// fetch('https://api.github.com/repos/vitejs/docs-cn/releases/latest')
|
|
||||||
// .then((res) => res.json())
|
|
||||||
// .then((json) => {
|
|
||||||
// const mainTitle = document.getElementById('main-title')
|
|
||||||
// mainTitle.style.position = 'relative'
|
|
||||||
|
|
||||||
// const docsReleaseTag = document.createElement('span')
|
|
||||||
// docsReleaseTag.classList.add('release-tag')
|
|
||||||
// const releaseTagName = json.tag_name
|
|
||||||
// docsReleaseTag.innerText = releaseTagName
|
|
||||||
|
|
||||||
// if (releaseTagName !== undefined) {
|
|
||||||
// mainTitle.appendChild(docsReleaseTag)
|
|
||||||
// }
|
|
||||||
// })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
fetchReleaseTag()
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<style>
|
<style>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user