docusaurus.config.js 11 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319
  1. const path = require('path')
  2. const organizationName = 'usthe' // Usually your GitHub org/user name.
  3. const projectName = 'sureness' // Usually your repo name.
  4. const branch = 'master'
  5. const repoUrl = `https://github.com/dromara/${projectName}`
  6. const cdnUrl = '/'
  7. module.exports = {
  8. title: 'TANCLOUD探云',
  9. tagline: '易用友好的高性能监控云',
  10. url: 'https://tancloud.cn',
  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/',
  92. },
  93. {
  94. label: '私有化部署',
  95. position: 'left',
  96. to: 'docs/',
  97. },
  98. {
  99. label: '反馈建议',
  100. position: 'left',
  101. items: [
  102. {
  103. label: 'Github Discussion',
  104. href: 'https://github.com/dromara/sureness/discussions',
  105. },
  106. {
  107. label: 'Gitter Channel',
  108. href: 'https://gitter.im/usthe/sureness',
  109. },
  110. {
  111. label: 'QQ Group - 390083213',
  112. href: 'https://qm.qq.com/cgi-bin/qm/qr?k=3IpzQjFOztJe464_eMBmDHfT0YTWK5Qa&jump_from=webapi',
  113. },
  114. ],
  115. },
  116. {
  117. label: '其它',
  118. position: 'left',
  119. items: [
  120. {
  121. label: 'Design',
  122. to: 'docs/design',
  123. },
  124. {
  125. label: 'Contributing',
  126. to: 'docs/contributing',
  127. },
  128. {
  129. label: 'Sponsor',
  130. to: 'docs/sponsor',
  131. },
  132. ],
  133. },
  134. {
  135. label: '登陆/注册',
  136. href: 'https://console.tancloud.cn',
  137. position: 'right',
  138. className: 'header-console-link'
  139. },
  140. ],
  141. },
  142. footer: {
  143. style: 'light',
  144. links: [
  145. {
  146. title: '产品介绍',
  147. items: [
  148. {
  149. label: '使用介绍',
  150. to: 'docs/introduce',
  151. },
  152. {
  153. label: '安装文档',
  154. to: 'docs/start/quickstart',
  155. },
  156. {
  157. label: 'High Performance',
  158. href: 'https://github.com/tomsun28/sureness-shiro-spring-security-benchmark',
  159. },
  160. {
  161. label: 'Dashboard',
  162. href: 'https://github.com/dromara/sureness/projects/1',
  163. },
  164. ],
  165. },
  166. {
  167. title: '探云科技',
  168. items: [
  169. {
  170. label: 'Dromara',
  171. href: 'https://dromara.org',
  172. },
  173. {
  174. label: 'Github Discussion',
  175. href: 'https://github.com/dromara/sureness/discussions',
  176. },
  177. {
  178. label: 'Gitter Channel',
  179. href: 'https://gitter.im/usthe/sureness',
  180. },
  181. {
  182. label: 'QQ Group - 390083213',
  183. href: 'https://qm.qq.com/cgi-bin/qm/qr?k=3IpzQjFOztJe464_eMBmDHfT0YTWK5Qa&jump_from=webapi',
  184. },
  185. ],
  186. },
  187. {
  188. title: '相关资源',
  189. items: [
  190. {
  191. label: 'Github仓库',
  192. href: 'https://github.com/usthe/hertzbeat',
  193. },
  194. {
  195. label: 'Gitee仓库',
  196. href: 'https://gitee.com/usthe/hertzbeat',
  197. },
  198. {
  199. label: 'HertzBeat赫兹节拍',
  200. href: 'https://hertzbeat.com',
  201. },
  202. {
  203. label: 'TanCloud探云',
  204. href: 'https://tancloud.cn',
  205. },
  206. ],
  207. },
  208. ],
  209. logo: {
  210. alt: 'TANCLOUD探云-易用友好的高性能监控云',
  211. src: cdnUrl + 'img/tancloud-brand.svg',
  212. href: 'https://tancloud.cn',
  213. },
  214. copyright: `Apache License 2.0 | Copyright © ${new Date().getFullYear()}`,
  215. },
  216. },
  217. presets: [
  218. [
  219. '@docusaurus/preset-classic', {
  220. docs: {
  221. sidebarPath: require.resolve('./sidebars.json'),
  222. // Please change this to your repo.
  223. // editUrl:'https://github.com/dromara/sureness/edit/master/home/',
  224. editUrl: `${repoUrl}/edit/${branch}/home/`,
  225. editLocalizedFiles: true,
  226. remarkPlugins: [
  227. [require('@docusaurus/remark-plugin-npm2yarn'), {sync: true}],
  228. ],
  229. },
  230. blog: {
  231. showReadingTime: true,
  232. postsPerPage: 3,
  233. feedOptions: {
  234. type: 'all',
  235. copyright: `Copyright © ${new Date().getFullYear()} TANCLOUD, Inc.`,
  236. },
  237. // Please change this to your repo.
  238. editUrl: `${repoUrl}/edit/${branch}/home/`,
  239. editLocalizedFiles: true,
  240. },
  241. theme: {
  242. customCss: require.resolve('./src/css/custom.css'),
  243. },
  244. },
  245. ],
  246. ],
  247. plugins: [
  248. [
  249. '@docusaurus/plugin-client-redirects',
  250. {
  251. fromExtensions: ['html'],
  252. }
  253. ],
  254. '@docusaurus/plugin-ideal-image',
  255. [
  256. '@docusaurus/plugin-pwa',
  257. {
  258. debug: false,
  259. offlineModeActivationStrategies: ['appInstalled', 'queryString'],
  260. // swRegister: false,
  261. swCustom: path.resolve(__dirname, 'src/sw.js'),
  262. pwaHead: [
  263. {
  264. tagName: 'link',
  265. rel: 'icon',
  266. href: cdnUrl + 'img/tancloud-logo.svg',
  267. },
  268. {
  269. tagName: 'link',
  270. rel: 'manifest',
  271. href: cdnUrl + 'manifest.json',
  272. },
  273. {
  274. tagName: 'meta',
  275. name: 'theme-color',
  276. content: 'rgb(234, 90, 7)',
  277. },
  278. {
  279. tagName: 'meta',
  280. name: 'apple-mobile-web-app-capable',
  281. content: 'yes',
  282. },
  283. {
  284. tagName: 'meta',
  285. name: 'apple-mobile-web-app-status-bar-style',
  286. content: '#000',
  287. },
  288. {
  289. tagName: 'link',
  290. rel: 'apple-touch-icon',
  291. href: cdnUrl + 'img/tancloud-logo.svg',
  292. },
  293. {
  294. tagName: 'link',
  295. rel: 'mask-icon',
  296. href: cdnUrl + 'img/tancloud-logo.svg',
  297. color: 'rgb(234, 90, 7)',
  298. },
  299. {
  300. tagName: 'meta',
  301. name: 'msapplication-TileImage',
  302. content: cdnUrl + 'img/tancloud-logo.svg',
  303. },
  304. {
  305. tagName: 'meta',
  306. name: 'msapplication-TileColor',
  307. content: '#000',
  308. },
  309. ],
  310. },
  311. ],
  312. ],
  313. themes: ['@docusaurus/theme-live-codeblock'],
  314. scripts: [
  315. 'https://cdn.jsdelivr.net/gh/buttons/buttons.github.io/buttons.js'
  316. ]
  317. }