-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathdocusaurus.config.ts
58 lines (49 loc) · 2.54 KB
/
docusaurus.config.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import type { Config } from '@docusaurus/types';
import type { ThemeConfig } from '@docusaurus/preset-classic';
import dotenv from "dotenv";
import branding from "./config/branding"; // Imports all branding options from the /config/branding.ts file.
import scripts from "./config/includedScripts";
import presets from "./config/presets";
import plugins from "./config/pluginsConfig";
import typesense from "./config/typesense";
import stylesheets from "./config/stylesheets";
import themeConfig from "./config/themeConfig/config";
dotenv.config(); // Imports environment variables from the .env file. The .env file should be in the root of the project.
const config: Config = {
markdown: {
mermaid: true, // enables mermaid diagrams in markdown files
},
themes: [
"@docusaurus/theme-mermaid", // Imports the mermaid library for rendering diagrams
"docusaurus-theme-openapi-docs", // Imports the openapi-docs theme for rendering OpenAPI documentation
...(process.env.TYPESENSE_HOST && process.env.TYPESENSE_API_SEARCH_KEY && process.env.TYPESENSE_COLLECTION_NAME && process.env.TYPESENSE_EXPORTS ?
["docusaurus-theme-search-typesense"] : []), // Only include Typesense theme if env vars are set
],
// All branding options can be modified at the /config/branding.ts file.
title: branding.title,
url: branding.url,
baseUrl: branding.baseUrl ?? "/",
favicon: branding.favicon ?? "/favicon.ico",
/* Errors are thrown if broken links, markdown links, anchors, or duplicate routes are found.
This is useful for catching errors during development.
More information can be found at: https://docusaurus.io/docs/api/docusaurus-config
*/
onBrokenLinks: "throw",
onBrokenMarkdownLinks: "throw",
onBrokenAnchors: "throw",
onDuplicateRoutes: "throw",
i18n: {
defaultLocale: "en-US", // Sets useful metadata for the site, such as HTML lang attribute.
locales: ["en-US"],
},
presets: presets, // All preset options can be modified at the /config/presets.js file.
plugins: plugins, // plugins of the site. All plugin options can be modified at the /config/pluginsConfig/index.ts file.
themeConfig: {
navbar: branding.navbar, // navbar of the site
typesense: typesense, // typesense configuration
...themeConfig,
} satisfies ThemeConfig,
stylesheets: stylesheets, // stylesheets of the site. All stylesheet options can be modified at the /config/stylesheets.js file.
scripts: scripts, // scripts of the site. All script options can be modified at the /config/includedScripts.ts file.
};
export default config;