shared.ts 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. import { defineConfig } from 'vitepress'
  2. import { projectUrl, editLinkPattern } from './common'
  3. export const commitRef = process.env.COMMIT_REF ?
  4. `<a href="${projectUrl}/commit/${process.env.COMMIT_REF}">` + process.env.COMMIT_REF.slice(0, 8) + '</a>' :
  5. 'dev'
  6. function thisYear() {
  7. return new Date().getFullYear()
  8. }
  9. export const sharedConfig = defineConfig({
  10. title: 'Nginx UI',
  11. description: 'Yet another Nginx Web UI',
  12. head: [
  13. ['link', { rel: 'icon', type: 'image/svg+xml', href: '/assets/logo.svg' }],
  14. ['meta', { name: 'theme-color', content: '#3682D8' }]
  15. ],
  16. lastUpdated: true,
  17. themeConfig: {
  18. logo: '/assets/logo.svg',
  19. search: {
  20. provider: 'local'
  21. },
  22. editLink: {
  23. pattern: editLinkPattern
  24. },
  25. footer: {
  26. message: `Released under the AGPL-3.0 License. (${commitRef})`,
  27. copyright: 'Copyright © 2021-' + thisYear() + ' Nginx UI Team'
  28. },
  29. socialLinks: [
  30. { icon: 'github', link: projectUrl }
  31. ]
  32. },
  33. vite: {
  34. server: {
  35. port: Number.parseInt(process.env.VITE_PORT ?? '3003')
  36. }
  37. }
  38. })