|
@@ -1,40 +1,27 @@
|
|
|
import { createRequire } from 'module'
|
|
|
-import { defineConfig } from 'vitepress'
|
|
|
+import { DefaultTheme, defineConfig } from 'vitepress'
|
|
|
|
|
|
const require = createRequire(import.meta.url)
|
|
|
const pkg = require('chinese-days/package.json')
|
|
|
|
|
|
export const en = defineConfig({
|
|
|
description: "A VitePress Site",
|
|
|
+
|
|
|
themeConfig: {
|
|
|
// https://vitepress.dev/reference/default-theme-config
|
|
|
nav: [
|
|
|
- { text: 'Guide', link: '/en/getting-started' },
|
|
|
- { text: 'Calendar', link: '/en/calendar' },
|
|
|
+ { text: 'Guide', link: '/en/guide/getting-started' },
|
|
|
+ { text: 'Calendar', link: '/en/demo/calendar' },
|
|
|
{
|
|
|
text: pkg.version,
|
|
|
- items: [
|
|
|
- {
|
|
|
- text: 'Changelog',
|
|
|
- link: 'https://github.com/vsme/chinese-days/blob/main/CHANGELOG.md'
|
|
|
- },
|
|
|
- {
|
|
|
- text: 'Contributing',
|
|
|
- link: 'https://github.com/vsme/chinese-days?tab=readme-ov-file#%E8%B4%A1%E7%8C%AE%E4%BB%A3%E7%A0%81'
|
|
|
- }
|
|
|
- ]
|
|
|
+ link: 'https://github.com/vsme/chinese-days/blob/main/CHANGELOG.md'
|
|
|
},
|
|
|
],
|
|
|
|
|
|
- sidebar: [
|
|
|
- {
|
|
|
- text: 'Examples',
|
|
|
- items: [
|
|
|
- { text: 'Markdown Examples', link: '/markdown-examples' },
|
|
|
- { text: 'Runtime API Examples', link: '/api-examples' }
|
|
|
- ]
|
|
|
- }
|
|
|
- ],
|
|
|
+ sidebar: {
|
|
|
+ '/en/guide/': { base: '/en/guide/', items: sidebarGuide() },
|
|
|
+ '/en/demo/': { base: '/en/demo/', items: sidebarDemo() }
|
|
|
+ },
|
|
|
|
|
|
socialLinks: [
|
|
|
{ icon: 'github', link: 'https://github.com/vsme/chinese-days' }
|
|
@@ -45,4 +32,58 @@ export const en = defineConfig({
|
|
|
copyright: 'Copyright © 2024-present Yawei Sun'
|
|
|
},
|
|
|
}
|
|
|
-})
|
|
|
+})
|
|
|
+
|
|
|
+function sidebarGuide(): DefaultTheme.SidebarItem[] {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ text: 'Introduction',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: 'What is Chinese Days', link: 'what-is-chinese-days' },
|
|
|
+ { text: 'Getting started', link: 'getting-started' },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: 'Holidays',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: 'Holidays', link: 'holidays' },
|
|
|
+ { text: 'Lieu Days', link: 'lieu-days' },
|
|
|
+ { text: 'Working Days', link: 'working-days' },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: '24 Solar Terms',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: 'Apis', link: '24-solar-terms' },
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ {
|
|
|
+ text: 'Lunar',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: 'Solar to Lunar', link: 'to-lunar' },
|
|
|
+ { text: 'Lunar to Solar', link: 'from-lunar' }
|
|
|
+ ]
|
|
|
+ },
|
|
|
+ { text: 'Contributing',
|
|
|
+ collapsed: false,
|
|
|
+ items: [
|
|
|
+ { text: 'Improve together', link: 'contributing' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|
|
|
+
|
|
|
+function sidebarDemo(): DefaultTheme.SidebarItem[] {
|
|
|
+ return [
|
|
|
+ {
|
|
|
+ text: 'Demo',
|
|
|
+ items: [
|
|
|
+ { text: 'Calendar', link: 'calendar' }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ ]
|
|
|
+}
|