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