|
| 1 | +import * as path from "path"; |
| 2 | +import { themes as prismThemes } from "prism-react-renderer"; |
| 3 | +import type { Config } from "@docusaurus/types"; |
| 4 | +import type * as Preset from "@docusaurus/preset-classic"; |
| 5 | +import sidebars from "./sidebars"; |
| 6 | +import versions from "./versions.json"; |
| 7 | + |
| 8 | +// This runs in Node.js - Don't use client-side code here (browser APIs, JSX...) |
| 9 | + |
| 10 | +const config: Config = { |
| 11 | + title: "InterSystems Documentation", |
| 12 | + tagline: "", |
| 13 | + favicon: "img/favicon.ico", |
| 14 | + |
| 15 | + url: "https://caretdev.github.io", |
| 16 | + // baseUrl: "/docs-intersystems/", |
| 17 | + baseUrl: "/", |
| 18 | + |
| 19 | + organizationName: "caretdev", |
| 20 | + projectName: "docs-intersystems", |
| 21 | + |
| 22 | + onBrokenLinks: "throw", |
| 23 | + onBrokenMarkdownLinks: "warn", |
| 24 | + |
| 25 | + i18n: { |
| 26 | + defaultLocale: "en", |
| 27 | + locales: ["en"], |
| 28 | + }, |
| 29 | + |
| 30 | + plugins: [ |
| 31 | + [ |
| 32 | + "cls-loader", |
| 33 | + { |
| 34 | + projectRoot: path.join(__dirname, "ref"), |
| 35 | + }, |
| 36 | + ], |
| 37 | + ], |
| 38 | + |
| 39 | + presets: [ |
| 40 | + // ["classic", {}], |
| 41 | + [ |
| 42 | + '@docusaurus/preset-classic', |
| 43 | + { |
| 44 | + docs: { |
| 45 | + sidebarPath: require.resolve('./sidebars.js'), |
| 46 | + }, |
| 47 | + theme: { |
| 48 | + customCss: require.resolve('./src/css/custom.css'), |
| 49 | + }, |
| 50 | + }, |
| 51 | + ], |
| 52 | + ], |
| 53 | + markdown: { |
| 54 | + parseFrontMatter: async (params) => { |
| 55 | + // Reuse the default parser |
| 56 | + const result = await params.defaultParseFrontMatter(params); |
| 57 | + |
| 58 | + result.frontMatter.pagination_prev = null; |
| 59 | + result.frontMatter.pagination_next = null; |
| 60 | + |
| 61 | + return result; |
| 62 | + }, |
| 63 | + }, |
| 64 | + |
| 65 | + themeConfig: { |
| 66 | + // Replace with your project's social card |
| 67 | + image: "img/docusaurus-social-card.jpg", |
| 68 | + navbar: { |
| 69 | + title: "InterSystems Documentation", |
| 70 | + logo: { |
| 71 | + alt: "InterSystems Docs Logo", |
| 72 | + src: "img/intersystems-docs.svg", |
| 73 | + }, |
| 74 | + items: [ |
| 75 | + { |
| 76 | + type: 'dropdown', |
| 77 | + to: 'ref', |
| 78 | + label: 'Class Reference', |
| 79 | + position: 'left', |
| 80 | + items: [ |
| 81 | + ...versions.map((version, i) => ({ |
| 82 | + label: version, |
| 83 | + to: i === 0 ? 'ref' : `ref/${version}`, |
| 84 | + })), |
| 85 | + ], |
| 86 | + }, |
| 87 | + { |
| 88 | + href: "https://github.com/caretdev/docs-intersystems", |
| 89 | + label: "GitHub", |
| 90 | + position: "right", |
| 91 | + }, |
| 92 | + ], |
| 93 | + }, |
| 94 | + prism: { |
| 95 | + theme: prismThemes.github, |
| 96 | + darkTheme: prismThemes.dracula, |
| 97 | + }, |
| 98 | + } satisfies Preset.ThemeConfig, |
| 99 | +}; |
| 100 | + |
| 101 | +export default config; |
0 commit comments