mirror of
https://github.com/reonokiy/blog.nokiy.net.git
synced 2025-06-16 19:51:07 +02:00
refactor: update language configuration
This commit is contained in:
parent
ff59dc1a7c
commit
22dc899a95
25 changed files with 53 additions and 188 deletions
|
@ -1,9 +1,8 @@
|
|||
---
|
||||
import { allLocales, defaultLocale } from '@/i18n/config'
|
||||
import { allLocales, defaultLocale } from '@/config'
|
||||
import Layout from '@/layouts/Layout.astro'
|
||||
|
||||
export async function getStaticPaths() {
|
||||
// 定义路径数组的类型
|
||||
type PathItem = {
|
||||
params: { about: string }
|
||||
props: { lang: string }
|
||||
|
@ -11,13 +10,13 @@ export async function getStaticPaths() {
|
|||
|
||||
const paths: PathItem[] = []
|
||||
|
||||
// 默认语言的关于页面
|
||||
// Default locale
|
||||
paths.push({
|
||||
params: { about: 'about' },
|
||||
props: { lang: defaultLocale },
|
||||
})
|
||||
|
||||
// 更多语言的关于页面
|
||||
// More locales
|
||||
allLocales.forEach((lang: string) => {
|
||||
if (lang !== defaultLocale) {
|
||||
paths.push({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue