config.ts 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. import {defineConfig} from 'vitepress'
  2. // https://vitepress.dev/reference/site-config
  3. function thisYear() {
  4. return new Date().getFullYear()
  5. }
  6. export default defineConfig({
  7. lang: 'en-US',
  8. title: 'Nginx UI',
  9. description: 'Yet another Nginx Web UI',
  10. lastUpdated: true,
  11. locales: {
  12. root: {
  13. label: 'English',
  14. lang: 'en'
  15. },
  16. zh_CN: {
  17. label: '简体中文',
  18. lang: 'zh_CN'
  19. }
  20. },
  21. themeConfig: {
  22. // https://vitepress.dev/reference/default-theme-config
  23. nav: [
  24. {text: 'Home', link: '/'},
  25. {text: 'Guide', link: '/guide/about'},
  26. {text: 'Demo', link: 'https://nginxui.jackyu.cn'}
  27. ],
  28. sidebar: sidebar(),
  29. editLink: {
  30. pattern: 'https://github.com/0xJacky/nginx-ui/edit/master/frontend/docs/:path'
  31. },
  32. search: {
  33. provider: 'local'
  34. },
  35. footer: {
  36. message: 'Released under the AGPL-3.0 License.',
  37. copyright: 'Copyright © 2021-' + thisYear() + ' Nginx UI Team'
  38. },
  39. socialLinks: [
  40. {icon: 'github', link: 'https://github.com/0xJacky/nginx-ui'}
  41. ]
  42. }
  43. })
  44. function sidebar() {
  45. return {
  46. '/guide/': [
  47. {
  48. text: 'Introduction',
  49. collapsed: false,
  50. items: [
  51. {text: 'What is Nginx UI?', link: '/guide/about'},
  52. {text: 'Getting Started', link: '/guide/getting-started'},
  53. {text: 'Nginx Proxy Example', link: '/guide/nginx-proxy-example'},
  54. {text: 'Contributing', link: '/guide/contributing'},
  55. {text: 'License', link: '/guide/license'}
  56. ]
  57. },
  58. {
  59. text: 'Configuration',
  60. collapsed: false,
  61. items: [
  62. {text: 'Server', link: '/guide/config-server'},
  63. {text: 'Nginx Log', link: '/guide/config-nginx-log'},
  64. {text: 'Open AI', link: '/guide/config-openai'}
  65. ]
  66. }
  67. ],
  68. '/zh_CN/guide/': [
  69. {
  70. text: '介绍',
  71. collapsed: false,
  72. items: [
  73. {text: '何为 Nginx UI?', link: '/zh_CN/guide/about'},
  74. {text: '即刻开始', link: '/zh_CN/guide/getting-started'},
  75. {text: 'Nginx 代理示例', link: '/zh_CN/guide/nginx-proxy-example'},
  76. {text: '贡献代码', link: '/zh_CN/guide/contributing'},
  77. {text: '开源协议', link: '/zh_CN/guide/license'}
  78. ]
  79. },
  80. {
  81. text: '配置',
  82. collapsed: false,
  83. items: [
  84. {text: '服务端', link: '/zh_CN/guide/config-server'},
  85. {text: 'Nginx 日志', link: '/zh_CN/guide/config-nginx-log'},
  86. {text: 'Open AI', link: '/zh_CN/guide/config-openai'}
  87. ]
  88. }
  89. ]
  90. }
  91. }