Skip to content

Commit

Permalink
refactor: add example for forks in other languages
Browse files Browse the repository at this point in the history
  • Loading branch information
ryan4yin committed Nov 14, 2024
1 parent 24c9d45 commit 9021679
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 7 deletions.
32 changes: 31 additions & 1 deletion docs/.vitepress/config/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ import { zh } from './zh'

export default defineConfig({
...shared,
title: "NixOS & Flakes Book",

rewrites: {
"en/:rest*": ":rest*",
},
locales: {
root: {
label: 'English',
Expand All @@ -15,6 +20,31 @@ export default defineConfig({
label: '简体中文',
...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/",
// },
// },
})

6 changes: 0 additions & 6 deletions docs/.vitepress/config/shared.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,6 @@ import { PageData, defineConfig } from "vitepress"
const require = createRequire(import.meta.url)

export const shared = defineConfig({
title: "NixOS & Flakes Book",

rewrites: {
"en/:rest*": ":rest*",
},

// Whether to get the last updated timestamp for each page using Git.
lastUpdated: true,
// remove trailing `.html`
Expand Down

0 comments on commit 9021679

Please sign in to comment.