config.ts 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. import { defaultTheme } from 'vuepress';
  2. import { googleAnalyticsPlugin } from '@vuepress/plugin-google-analytics';
  3. import { registerComponentsPlugin } from '@vuepress/plugin-register-components';
  4. import { defineUserConfig } from '@vuepress/cli';
  5. import path from 'path';
  6. export default defineUserConfig({
  7. title: 'DPlayer',
  8. description: '🍭 Wow, such a lovely HTML5 danmaku video player',
  9. plugins: [
  10. googleAnalyticsPlugin({
  11. id: 'G-QEBJJDX922',
  12. }),
  13. registerComponentsPlugin({
  14. componentsDir: path.resolve(__dirname, './components'),
  15. }),
  16. ],
  17. locales: {
  18. '/zh/': {
  19. lang: 'zh-CN',
  20. },
  21. '/': {
  22. lang: 'en-US',
  23. },
  24. },
  25. theme: defaultTheme({
  26. repo: 'DIYgod/DPlayer',
  27. docsDir: 'docs',
  28. logo: '/logo.png',
  29. locales: {
  30. '/zh/': {
  31. selectLanguageName: '简体中文',
  32. navbar: [
  33. {
  34. text: '指南',
  35. link: '/zh/guide/',
  36. },
  37. {
  38. text: '生态',
  39. link: '/zh/ecosystem/',
  40. },
  41. {
  42. text: '支持 DPlayer',
  43. link: '/zh/support/',
  44. },
  45. ],
  46. },
  47. '/': {
  48. selectLanguageName: 'English',
  49. navbar: [
  50. {
  51. text: 'Guide',
  52. link: '/guide/',
  53. },
  54. {
  55. text: 'Ecosystem',
  56. link: '/ecosystem/',
  57. },
  58. {
  59. text: 'Support DPlayer',
  60. link: '/support/',
  61. },
  62. ],
  63. },
  64. },
  65. }),
  66. head: [
  67. ['link', { rel: 'icon', href: `/logo.png` }],
  68. ['script', { src: 'https://cdn.jsdelivr.net/npm/flv.js/dist/flv.min.js' }],
  69. ['script', { src: 'https://cdn.jsdelivr.net/npm/hls.js/dist/hls.min.js' }],
  70. ['script', { src: 'https://cdn.jsdelivr.net/npm/dashjs/dist/dash.all.min.js' }],
  71. ['script', { src: 'https://cdn.jsdelivr.net/webtorrent/latest/webtorrent.min.js' }],
  72. ['script', { src: 'https://cdn.jsdelivr.net/npm/dplayer/dist/DPlayer.min.js' }],
  73. ],
  74. });