mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2025-02-23 13:31:06 +08:00
site: derive document.title by path when doing init
This commit is contained in:
parent
595cc449c0
commit
dae5913596
@ -15,6 +15,12 @@
|
||||
</head>
|
||||
<body>
|
||||
<script>
|
||||
const path = window.location.pathname
|
||||
const pathLocale = path.startsWith('/en-US')
|
||||
? 'en-US'
|
||||
: path.startsWith('/zh-CN')
|
||||
? 'zh-CN'
|
||||
: undefined
|
||||
function deriveTitleFromLocale(locale = navigator.language) {
|
||||
if (locale === 'zh-CN') {
|
||||
document.title = 'Naive UI: 一个 Vue 3 组件库'
|
||||
@ -22,7 +28,7 @@
|
||||
document.title = 'Naive UI: A Vue 3 Component Library'
|
||||
}
|
||||
}
|
||||
deriveTitleFromLocale()
|
||||
deriveTitleFromLocale(pathLocale)
|
||||
</script>
|
||||
<div id="app"></div>
|
||||
<script type="module" src="__INDEX__"></script>
|
||||
|
Loading…
Reference in New Issue
Block a user