docusaurus.config.js 11 KB

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