|
| 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 | +import {execSync} from 'child_process'; |
| 5 | + |
| 6 | +// Get build info |
| 7 | +const gitSha = process.env.GITHUB_SHA || execSync('git rev-parse HEAD').toString().trim(); |
| 8 | +const gitShaShort = gitSha.slice(0, 7); |
| 9 | +const buildDate = new Date().toISOString().split('T')[0]; |
| 10 | + |
| 11 | +const config: Config = { |
| 12 | + title: 'NDX Architecture', |
| 13 | + tagline: 'NDX Innovation Sandbox Platform Documentation', |
| 14 | + favicon: 'img/favicon.ico', |
| 15 | + |
| 16 | + url: 'https://co-cddo.github.io', |
| 17 | + baseUrl: '/ndx-try-arch/', |
| 18 | + |
| 19 | + organizationName: 'co-cddo', |
| 20 | + projectName: 'ndx-try-arch', |
| 21 | + trailingSlash: false, |
| 22 | + |
| 23 | + onBrokenLinks: 'warn', |
| 24 | + onBrokenMarkdownLinks: 'warn', |
| 25 | + |
| 26 | + i18n: { |
| 27 | + defaultLocale: 'en', |
| 28 | + locales: ['en'], |
| 29 | + }, |
| 30 | + |
| 31 | + markdown: { |
| 32 | + mermaid: true, |
| 33 | + }, |
| 34 | + |
| 35 | + themes: ['@docusaurus/theme-mermaid'], |
| 36 | + |
| 37 | + presets: [ |
| 38 | + [ |
| 39 | + 'classic', |
| 40 | + { |
| 41 | + docs: { |
| 42 | + sidebarPath: './sidebars.ts', |
| 43 | + editUrl: 'https://github.com/co-cddo/ndx-try-arch/tree/main/website/', |
| 44 | + }, |
| 45 | + blog: false, |
| 46 | + theme: { |
| 47 | + customCss: './src/css/custom.css', |
| 48 | + }, |
| 49 | + } satisfies Preset.Options, |
| 50 | + ], |
| 51 | + ], |
| 52 | + |
| 53 | + themeConfig: { |
| 54 | + image: 'img/docusaurus-social-card.jpg', |
| 55 | + navbar: { |
| 56 | + title: 'NDX Architecture', |
| 57 | + logo: { |
| 58 | + alt: 'NDX Logo', |
| 59 | + src: 'img/logo.svg', |
| 60 | + }, |
| 61 | + items: [ |
| 62 | + { |
| 63 | + type: 'docSidebar', |
| 64 | + sidebarId: 'docsSidebar', |
| 65 | + position: 'left', |
| 66 | + label: 'Documentation', |
| 67 | + }, |
| 68 | + { |
| 69 | + href: 'https://github.com/co-cddo/ndx-try-arch', |
| 70 | + label: 'GitHub', |
| 71 | + position: 'right', |
| 72 | + }, |
| 73 | + ], |
| 74 | + }, |
| 75 | + footer: { |
| 76 | + style: 'dark', |
| 77 | + links: [ |
| 78 | + { |
| 79 | + title: 'Documentation', |
| 80 | + items: [ |
| 81 | + { |
| 82 | + label: 'Overview', |
| 83 | + to: '/docs/', |
| 84 | + }, |
| 85 | + { |
| 86 | + label: 'Architecture', |
| 87 | + to: '/docs/80-c4-architecture', |
| 88 | + }, |
| 89 | + ], |
| 90 | + }, |
| 91 | + { |
| 92 | + title: 'Resources', |
| 93 | + items: [ |
| 94 | + { |
| 95 | + label: 'GitHub', |
| 96 | + href: 'https://github.com/co-cddo/ndx-try-arch', |
| 97 | + }, |
| 98 | + ], |
| 99 | + }, |
| 100 | + ], |
| 101 | + copyright: `Copyright © ${new Date().getFullYear()} Government Digital Service (GDS), DSIT. Built ${buildDate} from <a href="https://github.com/co-cddo/ndx-try-arch/tree/${gitSha}">${gitShaShort}</a>.`, |
| 102 | + }, |
| 103 | + prism: { |
| 104 | + theme: prismThemes.github, |
| 105 | + darkTheme: prismThemes.dracula, |
| 106 | + additionalLanguages: ['bash', 'json', 'yaml', 'typescript'], |
| 107 | + }, |
| 108 | + mermaid: { |
| 109 | + theme: { |
| 110 | + light: 'neutral', |
| 111 | + dark: 'dark', |
| 112 | + }, |
| 113 | + }, |
| 114 | + } satisfies Preset.ThemeConfig, |
| 115 | +}; |
| 116 | + |
| 117 | +export default config; |
0 commit comments