en.ts 2.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  1. import { createRequire } from 'module'
  2. import { DefaultTheme, defineConfig } from 'vitepress'
  3. const require = createRequire(import.meta.url)
  4. const pkg = require('chinese-days/package.json')
  5. export const en = defineConfig({
  6. description: "A VitePress Site",
  7. themeConfig: {
  8. // https://vitepress.dev/reference/default-theme-config
  9. nav: [
  10. { text: 'Guide', link: '/en/guide/what-is-chinese-days' },
  11. { text: 'Demo', link: '/en/demo/calendar' },
  12. {
  13. text: pkg.version,
  14. link: 'https://github.com/vsme/chinese-days/blob/main/CHANGELOG.md'
  15. },
  16. ],
  17. sidebar: {
  18. '/en/guide/': { base: '/en/guide/', items: sidebarGuide() },
  19. '/en/demo/': { base: '/en/demo/', items: sidebarDemo() }
  20. },
  21. socialLinks: [
  22. { icon: 'github', link: 'https://github.com/vsme/chinese-days' }
  23. ],
  24. footer: {
  25. message: 'Released under the MIT License.',
  26. copyright: 'Copyright © 2024-present Yawei Sun'
  27. },
  28. }
  29. })
  30. function sidebarGuide(): DefaultTheme.SidebarItem[] {
  31. return [
  32. {
  33. text: 'Introduction',
  34. collapsed: false,
  35. items: [
  36. { text: 'What is Chinese Days', link: 'what-is-chinese-days' },
  37. { text: 'iCal Subscription', link: 'ical-subscription' },
  38. { text: 'Getting started', link: 'getting-started' },
  39. ]
  40. },
  41. {
  42. text: 'Holidays',
  43. collapsed: false,
  44. items: [
  45. { text: 'Holidays', link: 'holidays' },
  46. { text: 'Lieu Days', link: 'lieu-days' },
  47. { text: 'Working Days', link: 'working-days' },
  48. ]
  49. },
  50. {
  51. text: '24 Solar Terms',
  52. collapsed: false,
  53. items: [
  54. { text: 'Apis', link: '24-solar-terms' },
  55. ]
  56. },
  57. {
  58. text: 'Lunar',
  59. collapsed: false,
  60. items: [
  61. { text: 'Solar to Lunar', link: 'to-lunar' },
  62. { text: 'Lunar to Solar', link: 'from-lunar' },
  63. { text: 'Lunar Folk Festival', link: 'lunar-folk-festival' },
  64. ]
  65. },
  66. { text: 'Else',
  67. collapsed: false,
  68. items: [
  69. { text: 'Contributing', link: 'contributing' },
  70. { text: 'Thank', link: 'thank' }
  71. ]
  72. }
  73. ]
  74. }
  75. function sidebarDemo(): DefaultTheme.SidebarItem[] {
  76. return [
  77. {
  78. text: 'Demo',
  79. items: [
  80. { text: 'Calendar', link: 'calendar' }
  81. ]
  82. }
  83. ]
  84. }