en.ts 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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/getting-started' },
  11. { text: 'Calendar', 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: 'Contributing',
  65. collapsed: false,
  66. items: [
  67. { text: 'Improve together', link: 'contributing' }
  68. ]
  69. }
  70. ]
  71. }
  72. function sidebarDemo(): DefaultTheme.SidebarItem[] {
  73. return [
  74. {
  75. text: 'Demo',
  76. items: [
  77. { text: 'Calendar', link: 'calendar' }
  78. ]
  79. }
  80. ]
  81. }