-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdocusaurus.config.ts
100 lines (84 loc) · 3.14 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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
import {themes as prismThemes} from 'prism-react-renderer';
import type {Config} from '@docusaurus/types';
import type * as Preset from '@docusaurus/preset-classic';
import Navbar from "./src/configs/navbar";
import PrismConfig from "./src/configs/prism";
import type * as OpenApiPlugin from "docusaurus-plugin-openapi-docs";
import { CSlantBlogConfig } from "./src/configs/openApiPlugins";
require('dotenv').config();
// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...)
const config: Config = {
title: process.env.BASE_NAME || 'CSlant API Docs',
tagline: 'CSlant API Documentation uses the OpenAPI Specification to provide a detailed reference for all available endpoints, request and response examples, and more.',
favicon: 'img/favicon.ico',
// Set the production url of your site here
url: process.env.DOCS_URL || 'https://api-docs.cslant.com',
// Set the /<baseUrl>/ pathname under which your site is served
// For GitHub pages deployment, it is often '/<projectName>/'
baseUrl: process.env.BASE_URL || '/',
// GitHub pages deployment config.
// If you aren't using GitHub pages, you don't need these.
organizationName: process.env.ORGANIZATION_NAME, // Usually your GitHub org/user name.
projectName: process.env.PROJECT_NAME, // Usually your repo name.
onBrokenLinks: 'throw',
onBrokenMarkdownLinks: 'warn',
markdown: {
mermaid: true,
},
// Even if you don't use internationalization, you can use this field to set
// useful metadata like html lang. For example, if your site is Chinese, you
// may want to replace "en" with "zh-Hans".
i18n: {
defaultLocale: 'en',
locales: ['en'],
},
presets: [
[
'classic',
{
docs: {
sidebarPath: './src/configs/sidebars.ts',
docItemComponent: "@theme/ApiItem", // Derived from docusaurus-theme-openapi
// Please change this to your repo.
// Remove this to remove the "edit this page" links.
editUrl: ({ docPath }) => `https://github.com/cslant/api-docs/edit/main/${docPath}`,
},
theme: {
customCss: './src/css/custom.css',
},
} satisfies Preset.Options,
],
],
themeConfig: {
// Replace with your project's social card
image: 'img/docusaurus-social-card.jpg',
navbar: Navbar as Preset.ThemeConfig['navbar'],
footer: {
style: 'dark',
copyright: `Copyright © ${new Date().getFullYear()} <a href="https://cslant.com" target="_blank" rel="noopener noreferrer">CSlant</a>`,
},
prism: PrismConfig,
} satisfies Preset.ThemeConfig,
baseUrlIssueBanner: false,
plugins: [
[
"docusaurus-plugin-openapi-docs",
{
id: "openapi",
docsPluginId: "classic",
config: {
blog: CSlantBlogConfig satisfies OpenApiPlugin.Options,
},
},
],
],
scripts: [
{
src: 'https://static.cloudflareinsights.com/beacon.min.js',
async: true,
'data-cf-beacon': `{"token": "${process.env.CLOUDFLARE_ANALYTICS_TOKEN}"}`,
},
],
themes: ["docusaurus-theme-openapi-docs", "@docusaurus/theme-mermaid"],
};
export default config;