docusaurus.config.ts 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150
  1. import {themes as prismThemes} from 'prism-react-renderer';
  2. import type {Config} from '@docusaurus/types';
  3. import type * as Preset from '@docusaurus/preset-classic';
  4. // This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
  5. const config: Config = {
  6. title: 'My Site',
  7. tagline: 'Dinosaurs are cool',
  8. favicon: 'img/favicon.ico',
  9. // Future flags, see https://docusaurus.io/docs/api/docusaurus-config#future
  10. future: {
  11. v4: true, // Improve compatibility with the upcoming Docusaurus v4
  12. },
  13. // Set the production url of your site here
  14. url: 'https://your-docusaurus-site.example.com',
  15. // Set the /<baseUrl>/ pathname under which your site is served
  16. // For GitHub pages deployment, it is often '/<projectName>/'
  17. baseUrl: '/',
  18. // GitHub pages deployment config.
  19. // If you aren't using GitHub pages, you don't need these.
  20. organizationName: 'facebook', // Usually your GitHub org/user name.
  21. projectName: 'docusaurus', // Usually your repo name.
  22. onBrokenLinks: 'throw',
  23. // Even if you don't use internationalization, you can use this field to set
  24. // useful metadata like html lang. For example, if your site is Chinese, you
  25. // may want to replace "en" with "zh-Hans".
  26. i18n: {
  27. defaultLocale: 'en',
  28. locales: ['en'],
  29. },
  30. presets: [
  31. [
  32. 'classic',
  33. {
  34. docs: {
  35. sidebarPath: './sidebars.ts',
  36. // Please change this to your repo.
  37. // Remove this to remove the "edit this page" links.
  38. editUrl:
  39. 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
  40. },
  41. blog: {
  42. showReadingTime: true,
  43. feedOptions: {
  44. type: ['rss', 'atom'],
  45. xslt: true,
  46. },
  47. // Please change this to your repo.
  48. // Remove this to remove the "edit this page" links.
  49. editUrl:
  50. 'https://github.com/facebook/docusaurus/tree/main/packages/create-docusaurus/templates/shared/',
  51. // Useful options to enforce blogging best practices
  52. onInlineTags: 'warn',
  53. onInlineAuthors: 'warn',
  54. onUntruncatedBlogPosts: 'warn',
  55. },
  56. theme: {
  57. customCss: './src/css/custom.css',
  58. },
  59. } satisfies Preset.Options,
  60. ],
  61. ],
  62. themeConfig: {
  63. // Replace with your project's social card
  64. image: 'img/docusaurus-social-card.jpg',
  65. colorMode: {
  66. respectPrefersColorScheme: true,
  67. },
  68. navbar: {
  69. title: 'My Site',
  70. logo: {
  71. alt: 'My Site Logo',
  72. src: 'img/logo.svg',
  73. },
  74. items: [
  75. {
  76. type: 'docSidebar',
  77. sidebarId: 'tutorialSidebar',
  78. position: 'left',
  79. label: 'Tutorial',
  80. },
  81. {to: '/blog', label: 'Blog', position: 'left'},
  82. {
  83. href: 'https://github.com/facebook/docusaurus',
  84. label: 'GitHub',
  85. position: 'right',
  86. },
  87. ],
  88. },
  89. footer: {
  90. style: 'dark',
  91. links: [
  92. {
  93. title: 'Docs',
  94. items: [
  95. {
  96. label: 'Tutorial',
  97. to: '/docs/intro',
  98. },
  99. ],
  100. },
  101. {
  102. title: 'Community',
  103. items: [
  104. {
  105. label: 'Stack Overflow',
  106. href: 'https://stackoverflow.com/questions/tagged/docusaurus',
  107. },
  108. {
  109. label: 'Discord',
  110. href: 'https://discordapp.com/invite/docusaurus',
  111. },
  112. {
  113. label: 'X',
  114. href: 'https://x.com/docusaurus',
  115. },
  116. ],
  117. },
  118. {
  119. title: 'More',
  120. items: [
  121. {
  122. label: 'Blog',
  123. to: '/blog',
  124. },
  125. {
  126. label: 'GitHub',
  127. href: 'https://github.com/facebook/docusaurus',
  128. },
  129. ],
  130. },
  131. ],
  132. copyright: `Copyright © ${new Date().getFullYear()} My Project, Inc. Built with Docusaurus.`,
  133. },
  134. prism: {
  135. theme: prismThemes.github,
  136. darkTheme: prismThemes.dracula,
  137. },
  138. } satisfies Preset.ThemeConfig,
  139. };
  140. export default config;