docusaurus.config.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301
  1. const path = require('path')
  2. const organizationName = 'dromara' // Usually your GitHub org/user name.
  3. const projectName = 'hertzbeat' // Usually your repo name.
  4. const branch = 'master'
  5. const repoUrl = `https://github.com/dromara/${projectName}`
  6. const cdnUrl = 'https://cdn.jsdelivr.net/gh/dromara/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/dromara/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/dromara/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. href: 'https://github.com/dromara/hertzbeat/projects/1',
  102. },
  103. {
  104. label: '其它',
  105. position: 'left',
  106. items: [
  107. {
  108. label: '设计文档',
  109. to: 'docs/others/design',
  110. },
  111. {
  112. label: '赞助我们',
  113. to: 'docs/others/sponsor',
  114. },
  115. {
  116. label: '相关资源',
  117. to: 'docs/others/resource',
  118. },
  119. ],
  120. },
  121. {
  122. label: '登陆/注册',
  123. href: 'https://console.tancloud.cn',
  124. position: 'right',
  125. className: 'header-console-link'
  126. },
  127. ],
  128. },
  129. footer: {
  130. style: 'light',
  131. links: [
  132. {
  133. title: '产品介绍',
  134. items: [
  135. {
  136. label: '使用介绍',
  137. to: 'docs/',
  138. },
  139. {
  140. label: '安装文档',
  141. to: 'docs/start/quickstart',
  142. },
  143. {
  144. label: '自定义监控',
  145. to: 'docs/advanced/extend-point'
  146. },
  147. {
  148. label: '帮助文档',
  149. to: 'docs/help/guide'
  150. },
  151. ],
  152. },
  153. {
  154. title: '社区交流',
  155. items: [
  156. {
  157. label: 'Dromara开源社区',
  158. href: 'https://dromara.org/',
  159. },
  160. {
  161. label: '交流联系',
  162. to: 'docs/others/contact',
  163. },
  164. {
  165. label: '用户交流网站',
  166. href: 'https://support.qq.com/products/379369',
  167. },
  168. {
  169. label: 'TanCloud探云',
  170. href: 'https://tancloud.cn',
  171. }
  172. ],
  173. },
  174. {
  175. title: '相关资源',
  176. items: [
  177. {
  178. label: 'Github仓库',
  179. href: 'https://github.com/dromara/hertzbeat',
  180. },
  181. {
  182. label: 'Gitee仓库',
  183. href: 'https://gitee.com/dromara/hertzbeat',
  184. },
  185. {
  186. label: '相关资源',
  187. to: 'docs/others/resource',
  188. },
  189. ],
  190. },
  191. ],
  192. logo: {
  193. alt: 'TANCLOUD探云-易用友好的高性能监控云',
  194. src: 'img/icons/dromara.png',
  195. href: 'https://dromara.org/zh/',
  196. },
  197. copyright: '<a target="_blank" href="https://beian.miit.gov.cn/">蜀ICP备2022002218号</a>' + ` | Copyright TANCLOUD© ${new Date().getFullYear()}`,
  198. },
  199. },
  200. presets: [
  201. [
  202. '@docusaurus/preset-classic', {
  203. docs: {
  204. sidebarPath: require.resolve('./sidebars.json'),
  205. // Please change this to your repo.
  206. editUrl: `${repoUrl}/edit/${branch}/home/`,
  207. editLocalizedFiles: true,
  208. remarkPlugins: [
  209. [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
  210. ],
  211. },
  212. blog: {
  213. showReadingTime: true,
  214. postsPerPage: 3,
  215. feedOptions: {
  216. type: 'all',
  217. copyright: `Copyright © ${new Date().getFullYear()} TANCLOUD, Inc.`,
  218. },
  219. // Please change this to your repo.
  220. editUrl: `${repoUrl}/edit/${branch}/home/`,
  221. editLocalizedFiles: true,
  222. },
  223. theme: {
  224. customCss: require.resolve('./src/css/custom.css'),
  225. },
  226. },
  227. ],
  228. ],
  229. plugins: [
  230. [
  231. '@docusaurus/plugin-client-redirects',
  232. {
  233. fromExtensions: ['html'],
  234. }
  235. ],
  236. '@docusaurus/plugin-ideal-image',
  237. [
  238. '@docusaurus/plugin-pwa',
  239. {
  240. debug: false,
  241. offlineModeActivationStrategies: ['appInstalled', 'queryString'],
  242. // swRegister: false,
  243. swCustom: path.resolve(__dirname, 'src/sw.js'),
  244. pwaHead: [
  245. {
  246. tagName: 'link',
  247. rel: 'icon',
  248. href: 'img/tancloud-logo.svg',
  249. },
  250. {
  251. tagName: 'link',
  252. rel: 'manifest',
  253. href: 'manifest.json',
  254. },
  255. {
  256. tagName: 'meta',
  257. name: 'theme-color',
  258. content: 'rgb(234, 90, 7)',
  259. },
  260. {
  261. tagName: 'meta',
  262. name: 'apple-mobile-web-app-capable',
  263. content: 'yes',
  264. },
  265. {
  266. tagName: 'meta',
  267. name: 'apple-mobile-web-app-status-bar-style',
  268. content: '#000',
  269. },
  270. {
  271. tagName: 'link',
  272. rel: 'apple-touch-icon',
  273. href: 'img/tancloud-logo.svg',
  274. },
  275. {
  276. tagName: 'link',
  277. rel: 'mask-icon',
  278. href: 'img/tancloud-logo.svg',
  279. color: 'rgb(234, 90, 7)',
  280. },
  281. {
  282. tagName: 'meta',
  283. name: 'msapplication-TileImage',
  284. content: 'img/tancloud-logo.svg',
  285. },
  286. {
  287. tagName: 'meta',
  288. name: 'msapplication-TileColor',
  289. content: '#000',
  290. },
  291. ],
  292. },
  293. ],
  294. ],
  295. themes: ['@docusaurus/theme-live-codeblock'],
  296. scripts: [
  297. 'https://cdn.jsdelivr.net/gh/buttons/buttons.github.io/buttons.js'
  298. ]
  299. }