docusaurus.config.js 5.2 KB

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