docusaurus.config.js 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176
  1. /** @type {import('@docusaurus/types').DocusaurusConfig} */
  2. import {themes as prismThemes} from 'prism-react-renderer'
  3. export default {
  4. title: 'David Windham | TIL',
  5. tagline: 'Because Today I Learned',
  6. url: 'https://davidawindham.com',
  7. baseUrl: '/til/',
  8. favicon: 'img/favicon.ico',
  9. organizationName: 'windhamdavid',
  10. projectName: 'til',
  11. markdown: {
  12. mermaid: true,
  13. hooks: {
  14. onBrokenMarkdownLinks: 'throw',
  15. onBrokenMarkdownImages: 'throw',
  16. },
  17. },
  18. themes: ['@docusaurus/theme-mermaid'],
  19. plugins: [
  20. 'plugin-image-zoom',
  21. require.resolve('docusaurus-plugin-matomo'),
  22. //require.resolve("@cmfcmf/docusaurus-search-local")
  23. [require.resolve('docusaurus-lunr-search'), {
  24. excludeRoutes: [
  25. 'lists/music/**/*', // exclude playlists from indexing
  26. ]
  27. }],
  28. [
  29. '@docusaurus/plugin-content-docs',
  30. {
  31. id: 'notes',
  32. path: 'notes',
  33. routeBasePath: 'notes',
  34. sidebarPath: require.resolve('./sidebarsnotes.js'),
  35. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  36. showLastUpdateTime: true,
  37. },
  38. ],
  39. [
  40. '@docusaurus/plugin-content-docs',
  41. {
  42. id: 'lists',
  43. path: 'lists',
  44. routeBasePath: 'lists',
  45. sidebarPath: require.resolve('./sidebarslists.js'),
  46. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  47. showLastUpdateTime: true,
  48. },
  49. ],
  50. [
  51. '@docusaurus/plugin-content-blog',
  52. {
  53. id: 'posts',
  54. path: 'posts',
  55. routeBasePath: 'posts',
  56. blogTitle: 'Posts',
  57. blogDescription: 'Posts by David Windham',
  58. postsPerPage: 'ALL',
  59. blogSidebarTitle: ' ',
  60. blogSidebarCount: 'ALL',
  61. feedOptions: {
  62. type: null,
  63. },
  64. showReadingTime: false,
  65. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  66. },
  67. ],
  68. [
  69. '@docusaurus/plugin-content-blog',
  70. {
  71. id: 'ideas',
  72. path: 'ideas',
  73. routeBasePath: 'ideas',
  74. blogTitle: 'Ideas',
  75. blogDescription: 'Ideas by David Windham',
  76. postsPerPage: 'ALL',
  77. blogSidebarTitle: 'Ideas',
  78. blogSidebarCount: 'ALL',
  79. feedOptions: {
  80. type: null,
  81. },
  82. showReadingTime: false,
  83. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  84. },
  85. ],
  86. ],
  87. themeConfig: {
  88. matomo: {
  89. matomoUrl: 'https://davidawindham.com/wik/',
  90. siteId: '1',
  91. phpLoader: 'matomo.php',
  92. jsLoader: 'matomo.js',
  93. },
  94. image: 'img/opengraph_image.jpg',
  95. imageZoom: {
  96. options: {
  97. margin: 40,
  98. background: '#484c57',
  99. scrollOffset: 0,
  100. },
  101. },
  102. docs: {
  103. sidebar: {
  104. hideable: true,
  105. autoCollapseCategories: true,
  106. },
  107. },
  108. prism: {
  109. theme: prismThemes.oneDark,
  110. additionalLanguages: ['php', 'rust', 'bash', 'shell-session', 'swift', 'diff'],
  111. },
  112. mermaid: {
  113. theme: {light: 'base', dark: 'base'},
  114. },
  115. colorMode: {
  116. defaultMode: 'dark',
  117. disableSwitch: false,
  118. respectPrefersColorScheme: false,
  119. },
  120. navbar: {
  121. hideOnScroll: true,
  122. title: 'TIL',
  123. logo: {
  124. alt: 'windhamdavid',
  125. src: 'img/zw.png',
  126. },
  127. items: [
  128. {to: 'about/',activeBasePath: 'til',label: 'About',position: 'left'},
  129. {to: 'ai', label: 'AI',position: 'left'},
  130. {to: 'docs/',activeBasePath: 'docs',label: 'Docs',position: 'left'},
  131. {to: 'lists/',activeBasePath: 'lists',label: 'Lists',position: 'left'},
  132. {to: 'notes/',activeBasePath: 'notes',label: 'Notes',position: 'left'},
  133. {to: 'posts/',activeBasePath: 'posts',label: 'Posts',position: 'left'},
  134. {to: 'help', label: 'Help', position: 'left'},
  135. {type: 'search', position: 'left'},
  136. {
  137. href: 'https://davidawindham.com/desk',
  138. label: 'David A. Windham',
  139. 'aria-label': 'David A. Windham',
  140. className: 'header-homepage-link',
  141. target: '_self',
  142. position: 'right',
  143. },
  144. ],
  145. },
  146. },
  147. presets: [
  148. [
  149. '@docusaurus/preset-classic',
  150. {
  151. docs: {
  152. sidebarPath: require.resolve('./sidebars.js'),
  153. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  154. showLastUpdateTime: true,
  155. },
  156. blog: {
  157. blogTitle: 'Posts',
  158. blogDescription: 'Posts by David Windham',
  159. postsPerPage: 'ALL',
  160. blogSidebarTitle: 'Posts',
  161. blogSidebarCount: 'ALL',
  162. feedOptions: {
  163. type: null,
  164. },
  165. showReadingTime: false,
  166. editUrl:'https://code.davidawindham.com/david/til/src/main/',
  167. },
  168. theme: {
  169. customCss: require.resolve('./src/css/custom.css'),
  170. },
  171. },
  172. ],
  173. ],
  174. };