docusaurus.config.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296
  1. const path = require('path')
  2. const organizationName = 'usthe' // Usually your GitHub org/user name.
  3. const projectName = 'hertzbeat' // Usually your repo name.
  4. const branch = 'master'
  5. const repoUrl = `https://github.com/usthe/${projectName}`
  6. const cdnUrl = 'https://cdn.jsdelivr.net/gh/usthe/hertzbeat@gh-pages/'
  7. module.exports = {
  8. title: 'TANCLOUD探云',
  9. tagline: '易用友好的高性能监控云',
  10. url: 'https://hertzbeat.com',
  11. baseUrl: '/',
  12. onBrokenLinks: 'throw',
  13. onBrokenMarkdownLinks: 'throw',
  14. favicon: cdnUrl + 'img/tancloud-logo.svg',
  15. organizationName,
  16. projectName,
  17. customFields: {
  18. repoUrl,
  19. cdnUrl
  20. },
  21. i18n: {
  22. defaultLocale: 'zh-cn',
  23. locales: ['zh-cn', 'en'],
  24. },
  25. themeConfig: {
  26. image: cdnUrl + 'img/tancloud-logo.svg',
  27. liveCodeBlock: {
  28. playgroundPosition: 'bottom',
  29. },
  30. colorMode: {
  31. defaultMode: 'light',
  32. disableSwitch: false,
  33. respectPrefersColorScheme: false,
  34. switchConfig: {
  35. darkIcon: '🌜',
  36. lightIcon: '☀️',
  37. // React inline style object
  38. // see https://reactjs.org/docs/dom-elements.html#style
  39. darkIconStyle: {
  40. marginLeft: '2px',
  41. },
  42. lightIconStyle: {
  43. marginLeft: '1px',
  44. },
  45. },
  46. },
  47. prism: {
  48. theme: require('prism-react-renderer/themes/github'),
  49. darkTheme: require('prism-react-renderer/themes/dracula'),
  50. additionalLanguages: ['java'],
  51. },
  52. algolia: {
  53. apiKey: 'c7c84bfcc1495156f5730309d821ba8c',
  54. indexName: 'sureness',
  55. // appId: 'GNVT7Z0UI2',
  56. contextualSearch: true,
  57. },
  58. announcementBar: {
  59. id: "github-star",
  60. content:
  61. '<font style="font-size: medium; font-weight: bolder">如果您喜欢TANCLOUD的开源产品HertzBeat,</font> <a target="_blank" style="font-size: medium; font-weight: bolder" rel="noopener noreferrer" href="https://github.com/usthe/hertzbeat">欢迎在 GitHub </a> <font style="font-size: medium; font-weight: bolder"> 或 </font><a target="_blank" style="font-size: medium; font-weight: bolder" rel="noopener noreferrer" href="https://gitee.com/usthe/hertzbeat">Gitee 给我们点赞! </a>⭐️',
  62. backgroundColor: '#7228B5',
  63. textColor: '#fafbfc',
  64. isCloseable: true,
  65. },
  66. navbar: {
  67. title: 'HertzBeat',
  68. logo: {
  69. alt: '易用友好的高性能监控云',
  70. src: cdnUrl + 'img/tancloud-logo.svg',
  71. },
  72. items: [
  73. {
  74. label: '首页',
  75. position: 'left',
  76. to: '/',
  77. },
  78. {
  79. label: '文档',
  80. position: 'left',
  81. to: 'docs/',
  82. },
  83. {
  84. label: '博客',
  85. position: 'left',
  86. to: 'blog/',
  87. },
  88. {
  89. label: '讨论交流',
  90. position: 'left',
  91. to: 'docs/others/contact',
  92. },
  93. {
  94. label: '私有化部署',
  95. position: 'left',
  96. to: 'docs/others/private',
  97. },
  98. {
  99. label: '其它',
  100. position: 'left',
  101. items: [
  102. {
  103. label: '设计文档',
  104. to: 'docs/others/design',
  105. },
  106. {
  107. label: '赞助我们',
  108. to: 'docs/others/sponsor',
  109. },
  110. {
  111. label: '相关资源',
  112. to: 'docs/others/resource',
  113. },
  114. ],
  115. },
  116. {
  117. label: '登陆/注册',
  118. href: 'https://console.tancloud.cn',
  119. position: 'right',
  120. className: 'header-console-link'
  121. },
  122. ],
  123. },
  124. footer: {
  125. style: 'light',
  126. links: [
  127. {
  128. title: '产品介绍',
  129. items: [
  130. {
  131. label: '使用介绍',
  132. to: 'docs/',
  133. },
  134. {
  135. label: '安装文档',
  136. to: 'docs/start/quickstart',
  137. },
  138. {
  139. label: '自定义监控',
  140. to: 'docs/advanced/extend-point'
  141. },
  142. {
  143. label: '帮助文档',
  144. to: 'docs/help/guide'
  145. },
  146. ],
  147. },
  148. {
  149. title: '探云科技',
  150. items: [
  151. {
  152. label: '交流联系',
  153. to: 'docs/others/contact',
  154. },
  155. {
  156. label: '社区网站',
  157. href: 'https://support.qq.com/products/379369',
  158. },
  159. {
  160. label: 'TANCLOUD探云',
  161. href: 'https://tancloud.cn',
  162. },
  163. {
  164. label: 'HertzBeat赫兹节拍',
  165. href: 'https://hertzbeat.com',
  166. },
  167. ],
  168. },
  169. {
  170. title: '相关资源',
  171. items: [
  172. {
  173. label: 'Github仓库',
  174. href: 'https://github.com/usthe/hertzbeat',
  175. },
  176. {
  177. label: 'Gitee仓库',
  178. href: 'https://gitee.com/usthe/hertzbeat',
  179. },
  180. {
  181. label: '相关资源',
  182. to: 'docs/others/resource',
  183. },
  184. ],
  185. },
  186. ],
  187. logo: {
  188. alt: 'TANCLOUD探云-易用友好的高性能监控云',
  189. src: cdnUrl + 'img/tancloud-brand.svg',
  190. href: 'https://tancloud.cn',
  191. },
  192. copyright: '<a target="_blank" href="https://beian.miit.gov.cn/">蜀ICP备2022002218号</a>' + ` | Copyright TANCLOUD© ${new Date().getFullYear()}`,
  193. },
  194. },
  195. presets: [
  196. [
  197. '@docusaurus/preset-classic', {
  198. docs: {
  199. sidebarPath: require.resolve('./sidebars.json'),
  200. // Please change this to your repo.
  201. editUrl: `${repoUrl}/edit/${branch}/home/`,
  202. editLocalizedFiles: true,
  203. remarkPlugins: [
  204. [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
  205. ],
  206. },
  207. blog: {
  208. showReadingTime: true,
  209. postsPerPage: 3,
  210. feedOptions: {
  211. type: 'all',
  212. copyright: `Copyright © ${new Date().getFullYear()} TANCLOUD, Inc.`,
  213. },
  214. // Please change this to your repo.
  215. editUrl: `${repoUrl}/edit/${branch}/home/`,
  216. editLocalizedFiles: true,
  217. },
  218. theme: {
  219. customCss: require.resolve('./src/css/custom.css'),
  220. },
  221. },
  222. ],
  223. ],
  224. plugins: [
  225. [
  226. '@docusaurus/plugin-client-redirects',
  227. {
  228. fromExtensions: ['html'],
  229. }
  230. ],
  231. '@docusaurus/plugin-ideal-image',
  232. [
  233. '@docusaurus/plugin-pwa',
  234. {
  235. debug: false,
  236. offlineModeActivationStrategies: ['appInstalled', 'queryString'],
  237. // swRegister: false,
  238. swCustom: path.resolve(__dirname, 'src/sw.js'),
  239. pwaHead: [
  240. {
  241. tagName: 'link',
  242. rel: 'icon',
  243. href: 'img/tancloud-logo.svg',
  244. },
  245. {
  246. tagName: 'link',
  247. rel: 'manifest',
  248. href: 'manifest.json',
  249. },
  250. {
  251. tagName: 'meta',
  252. name: 'theme-color',
  253. content: 'rgb(234, 90, 7)',
  254. },
  255. {
  256. tagName: 'meta',
  257. name: 'apple-mobile-web-app-capable',
  258. content: 'yes',
  259. },
  260. {
  261. tagName: 'meta',
  262. name: 'apple-mobile-web-app-status-bar-style',
  263. content: '#000',
  264. },
  265. {
  266. tagName: 'link',
  267. rel: 'apple-touch-icon',
  268. href: 'img/tancloud-logo.svg',
  269. },
  270. {
  271. tagName: 'link',
  272. rel: 'mask-icon',
  273. href: 'img/tancloud-logo.svg',
  274. color: 'rgb(234, 90, 7)',
  275. },
  276. {
  277. tagName: 'meta',
  278. name: 'msapplication-TileImage',
  279. content: 'img/tancloud-logo.svg',
  280. },
  281. {
  282. tagName: 'meta',
  283. name: 'msapplication-TileColor',
  284. content: '#000',
  285. },
  286. ],
  287. },
  288. ],
  289. ],
  290. themes: ['@docusaurus/theme-live-codeblock'],
  291. scripts: [
  292. 'https://cdn.jsdelivr.net/gh/buttons/buttons.github.io/buttons.js'
  293. ]
  294. }