mirror of
https://github.com/ryan4yin/nixos-and-flakes-book.git
synced 2024-11-24 17:13:12 +01:00
refactor: add example for forks in other languages
This commit is contained in:
parent
24c9d45f0d
commit
9021679b53
@ -6,6 +6,11 @@ import { zh } from './zh'
|
|||||||
|
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
...shared,
|
...shared,
|
||||||
|
title: "NixOS & Flakes Book",
|
||||||
|
|
||||||
|
rewrites: {
|
||||||
|
"en/:rest*": ":rest*",
|
||||||
|
},
|
||||||
locales: {
|
locales: {
|
||||||
root: {
|
root: {
|
||||||
label: 'English',
|
label: 'English',
|
||||||
@ -15,6 +20,31 @@ export default defineConfig({
|
|||||||
label: '简体中文',
|
label: '简体中文',
|
||||||
...zh
|
...zh
|
||||||
},
|
},
|
||||||
}
|
},
|
||||||
|
|
||||||
|
// For forks in other languages, here is an example of how to add a new locale:
|
||||||
|
// rewrites: {
|
||||||
|
// "ja/:rest*": ":rest*",
|
||||||
|
// },
|
||||||
|
// // Exclude the original language's markdown files when build dist
|
||||||
|
// // NOTE: You can still preview the original language's pages in dev mode
|
||||||
|
// srcExclude: ['zh/**/*.md', 'en/**/*.md'],
|
||||||
|
// locales: {
|
||||||
|
// // Your language's root configuration
|
||||||
|
// root: {
|
||||||
|
// label: 'Japanese',
|
||||||
|
// ...ja,
|
||||||
|
// },
|
||||||
|
//
|
||||||
|
// // Languages maintained by the original author
|
||||||
|
// en: {
|
||||||
|
// label: 'English',
|
||||||
|
// link: "https://nixos-and-flakes.thiscute.world/",
|
||||||
|
// },
|
||||||
|
// zh: {
|
||||||
|
// label: '简体中文',
|
||||||
|
// link: "https://nixos-and-flakes.thiscute.world/zh/",
|
||||||
|
// },
|
||||||
|
// },
|
||||||
})
|
})
|
||||||
|
|
||||||
|
@ -5,12 +5,6 @@ import { PageData, defineConfig } from "vitepress"
|
|||||||
const require = createRequire(import.meta.url)
|
const require = createRequire(import.meta.url)
|
||||||
|
|
||||||
export const shared = defineConfig({
|
export const shared = defineConfig({
|
||||||
title: "NixOS & Flakes Book",
|
|
||||||
|
|
||||||
rewrites: {
|
|
||||||
"en/:rest*": ":rest*",
|
|
||||||
},
|
|
||||||
|
|
||||||
// Whether to get the last updated timestamp for each page using Git.
|
// Whether to get the last updated timestamp for each page using Git.
|
||||||
lastUpdated: true,
|
lastUpdated: true,
|
||||||
// remove trailing `.html`
|
// remove trailing `.html`
|
||||||
|
Loading…
Reference in New Issue
Block a user