docusaurus.config.js 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297
  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://tancloud.gd2.qingstor.com/'
  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/sureness">欢迎在 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/sureness">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:'https://github.com/dromara/sureness/edit/master/home/',
  202. editUrl: `${repoUrl}/edit/${branch}/home/`,
  203. editLocalizedFiles: true,
  204. remarkPlugins: [
  205. [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
  206. ],
  207. },
  208. blog: {
  209. showReadingTime: true,
  210. postsPerPage: 3,
  211. feedOptions: {
  212. type: 'all',
  213. copyright: `Copyright © ${new Date().getFullYear()} TANCLOUD, Inc.`,
  214. },
  215. // Please change this to your repo.
  216. editUrl: `${repoUrl}/edit/${branch}/home/`,
  217. editLocalizedFiles: true,
  218. },
  219. theme: {
  220. customCss: require.resolve('./src/css/custom.css'),
  221. },
  222. },
  223. ],
  224. ],
  225. plugins: [
  226. [
  227. '@docusaurus/plugin-client-redirects',
  228. {
  229. fromExtensions: ['html'],
  230. }
  231. ],
  232. '@docusaurus/plugin-ideal-image',
  233. [
  234. '@docusaurus/plugin-pwa',
  235. {
  236. debug: false,
  237. offlineModeActivationStrategies: ['appInstalled', 'queryString'],
  238. // swRegister: false,
  239. swCustom: path.resolve(__dirname, 'src/sw.js'),
  240. pwaHead: [
  241. {
  242. tagName: 'link',
  243. rel: 'icon',
  244. href: cdnUrl + 'img/tancloud-logo.svg',
  245. },
  246. {
  247. tagName: 'link',
  248. rel: 'manifest',
  249. href: cdnUrl + 'manifest.json',
  250. },
  251. {
  252. tagName: 'meta',
  253. name: 'theme-color',
  254. content: 'rgb(234, 90, 7)',
  255. },
  256. {
  257. tagName: 'meta',
  258. name: 'apple-mobile-web-app-capable',
  259. content: 'yes',
  260. },
  261. {
  262. tagName: 'meta',
  263. name: 'apple-mobile-web-app-status-bar-style',
  264. content: '#000',
  265. },
  266. {
  267. tagName: 'link',
  268. rel: 'apple-touch-icon',
  269. href: cdnUrl + 'img/tancloud-logo.svg',
  270. },
  271. {
  272. tagName: 'link',
  273. rel: 'mask-icon',
  274. href: cdnUrl + 'img/tancloud-logo.svg',
  275. color: 'rgb(234, 90, 7)',
  276. },
  277. {
  278. tagName: 'meta',
  279. name: 'msapplication-TileImage',
  280. content: cdnUrl + 'img/tancloud-logo.svg',
  281. },
  282. {
  283. tagName: 'meta',
  284. name: 'msapplication-TileColor',
  285. content: '#000',
  286. },
  287. ],
  288. },
  289. ],
  290. ],
  291. themes: ['@docusaurus/theme-live-codeblock'],
  292. scripts: [
  293. 'https://cdn.jsdelivr.net/gh/buttons/buttons.github.io/buttons.js'
  294. ]
  295. }