en.ts 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990
  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: 'Getting started', link: 'getting-started' },
  38. ]
  39. },
  40. {
  41. text: 'Holidays',
  42. collapsed: false,
  43. items: [
  44. { text: 'Holidays', link: 'holidays' },
  45. { text: 'Lieu Days', link: 'lieu-days' },
  46. { text: 'Working Days', link: 'working-days' },
  47. ]
  48. },
  49. {
  50. text: '24 Solar Terms',
  51. collapsed: false,
  52. items: [
  53. { text: 'Apis', link: '24-solar-terms' },
  54. ]
  55. },
  56. {
  57. text: 'Lunar',
  58. collapsed: false,
  59. items: [
  60. { text: 'Solar to Lunar', link: 'to-lunar' },
  61. { text: 'Lunar to Solar', link: 'from-lunar' }
  62. ]
  63. },
  64. { text: 'Else',
  65. collapsed: false,
  66. items: [
  67. { text: 'Contributing', link: 'contributing' },
  68. { text: 'Thank', link: 'thank' }
  69. ]
  70. }
  71. ]
  72. }
  73. function sidebarDemo(): DefaultTheme.SidebarItem[] {
  74. return [
  75. {
  76. text: 'Demo',
  77. items: [
  78. { text: 'Calendar', link: 'calendar' }
  79. ]
  80. }
  81. ]
  82. }