config.js 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147
  1. module.exports = {
  2. base: '/LuckysheetDocs/',
  3. locales: {
  4. // 键名是该语言所属的子路径
  5. // 作为特例,默认语言可以使用 '/' 作为其路径。
  6. '/': {
  7. lang: 'en-US', // 将会被设置为 <html> 的 lang 属性
  8. title: 'Luckysheet Document',
  9. description: 'Luckysheet is an online spreadsheet like excel that is powerful, simple to configure, and completely open source.This site contains official configuration document, API, and tutorial.'
  10. },
  11. '/zh/': {
  12. lang: 'zh-CN',
  13. title: 'Luckysheet文档',
  14. description: 'Luckysheet ,一款纯前端类似excel的在线表格,功能强大、配置简单、完全开源。本站包含官方配置文档,API,教程。'
  15. },
  16. },
  17. themeConfig: {
  18. domain: 'https://mengshukeji.github.io/LuckysheetDemo',
  19. logo: '/img/logo.png',
  20. author: 'Luckysheet',
  21. // 仓库地址
  22. repo: 'mengshukeji/Luckysheet',
  23. // 允许编辑链接文字
  24. editLinks: true,
  25. // 仓库的文档目录
  26. docsDir: 'docs',
  27. // 页面滚动
  28. smoothScroll: true,
  29. locales: {
  30. '/': {
  31. selectText: 'Languages',
  32. label: 'English',
  33. ariaLabel: 'Select language',
  34. editLinkText: 'Edit this page on GitHub',
  35. lastUpdated: 'Last Updated',
  36. serviceWorker: {
  37. updatePopup: {
  38. message: "New content is available.",
  39. buttonText: "Refresh"
  40. }
  41. },
  42. nav: [
  43. { text: 'Home', link: '/' },
  44. { text: 'Guide', link: '/guide/' },
  45. { text: 'Demo', link: 'https://mengshukeji.github.io/LuckysheetDemo/' },
  46. {
  47. text: 'More',
  48. ariaLabel: 'More',
  49. items: [
  50. { text: 'About', link: '/about/' }
  51. ]
  52. },
  53. ],
  54. // 侧边栏
  55. sidebar: {
  56. '/guide/': [
  57. '',
  58. 'config',
  59. 'sheet',
  60. 'cell',
  61. 'operate',
  62. 'api',
  63. 'resource',
  64. 'FAQ',
  65. 'contribute'
  66. ],
  67. '/about/': [
  68. '',
  69. 'sponsor',
  70. 'company'
  71. ],
  72. },
  73. },
  74. '/zh/': {
  75. // 多语言下拉菜单的标题
  76. selectText: '选择语言',
  77. // 该语言在下拉菜单中的标签
  78. label: '简体中文',
  79. ariaLabel: '选择语言',
  80. // 编辑链接文字
  81. editLinkText: '在 GitHub 上编辑此页',
  82. lastUpdated: '上次更新',
  83. // Service Worker 的配置
  84. serviceWorker: {
  85. updatePopup: {
  86. message: "发现新内容可用.",
  87. buttonText: "刷新"
  88. }
  89. },
  90. // 导航栏
  91. nav: [
  92. { text: '首页', link: '/zh/' },
  93. { text: '指南', link: '/zh/guide/' },
  94. { text: '演示', link: 'https://mengshukeji.github.io/LuckysheetDemo/' },
  95. {
  96. text: '了解更多',
  97. ariaLabel: '了解更多',
  98. items: [
  99. { text: '关于', link: '/zh/about/' }
  100. ]
  101. },
  102. ],
  103. // 侧边栏
  104. sidebar: {
  105. '/zh/guide/': [
  106. '',
  107. 'config',
  108. 'sheet',
  109. 'cell',
  110. 'operate',
  111. 'api',
  112. 'resource',
  113. 'FAQ',
  114. 'contribute'
  115. ],
  116. '/zh/about/': [
  117. '',
  118. 'sponsor',
  119. 'company'
  120. ],
  121. },
  122. },
  123. },
  124. },
  125. plugins: {
  126. 'vuepress-plugin-baidu-autopush': {},
  127. 'sitemap': {
  128. hostname: 'https://mengshukeji.github.io/LuckysheetDocs'
  129. },
  130. 'vuepress-plugin-code-copy': true,
  131. 'seo': {
  132. siteTitle: (_, $site) => $site.title,
  133. title: $page => $page.title,
  134. description: $page => $page.frontmatter.description,
  135. author: (_, $site) => $site.themeConfig.author,
  136. tags: $page => $page.frontmatter.tags,
  137. twitterCard: _ => 'summary_large_image',
  138. type: $page => ['guide'].some(folder => $page.regularPath.startsWith('/' + folder)) ? 'article' : 'website',
  139. url: (_, $site, path) => ($site.themeConfig.domain || '') + path,
  140. image: ($page, $site) => $page.frontmatter.image && (($site.themeConfig.domain && !$page.frontmatter.image.startsWith('http') || '') + $page.frontmatter.image),
  141. publishedAt: $page => $page.frontmatter.date && new Date($page.frontmatter.date),
  142. modifiedAt: $page => $page.lastUpdated && new Date($page.lastUpdated),
  143. }
  144. }
  145. }