microsoft/hve-core

Public

mirrored fromhttps://github.com/microsoft/hve-coreAvailable

CodeCommitsIssuesPull requestsActionsInsightsSecurity
0d4452b33c2409d03315019dae0d34e468641dfb

Branches

Tags

  • No tags available.
0Branches0Tags
Go to file
Add file
Code

Clone

HTTPS

Download ZIP

docs/docusaurus/docusaurus.config.js

197lines · modecode

1// @ts-check
2import { themes as prismThemes } from 'prism-react-renderer';
3import remarkGithubAlert from 'remark-github-blockquote-alert';
4import * as fs from 'fs';
5import * as path from 'path';
6
7const collectionsDir = path.resolve(__dirname, '../../collections');
8
9/**
10 * @param {string} name
11 */
12function countYamlPaths(name) {
13 const yamlPath = path.join(collectionsDir, `${name}.collection.yml`);
14 let content;
15 try {
16 content = fs.readFileSync(yamlPath, 'utf-8');
17 } catch {
18 throw new Error(
19 `[docusaurus.config.js] Cannot read collection manifest: ${yamlPath}\n` +
20 `Ensure "${name}" exists in the collections/ directory.`,
21 );
22 }
23 return (content.match(/^\s*- path:/gm) || []).length;
24}
25
26const collectionNames = [
27 'ado', 'coding-standards', 'data-science', 'design-thinking',
28 'experimental', 'github', 'gitlab', 'hve-core', 'jira',
29 'project-planning', 'security', 'hve-core-all',
30];
31const collectionCounts = Object.fromEntries(
32 collectionNames.map((n) => [n, countYamlPaths(n)]),
33);
34
35/** @type {import('@docusaurus/types').Config} */
36const config = {
37 title: 'HVE Core',
38 tagline: 'AI-Driven Software Development Across the Full Lifecycle',
39 favicon: 'img/microsoft-logo.svg',
40
41 future: {
42 v4: true,
43 },
44
45 url: 'https://microsoft.github.io',
46 baseUrl: '/hve-core/',
47
48 organizationName: 'microsoft',
49 projectName: 'hve-core',
50
51 onBrokenLinks: 'throw',
52
53 customFields: {
54 collectionCounts,
55 },
56
57 markdown: {
58 hooks: {
59 onBrokenMarkdownLinks: 'throw',
60 },
61 },
62
63 i18n: {
64 defaultLocale: 'en',
65 locales: ['en'],
66 },
67
68 presets: [
69 [
70 'classic',
71 /** @type {import('@docusaurus/preset-classic').Options} */
72 ({
73 docs: {
74 path: '../',
75 exclude: [
76 'docusaurus/**',
77 'announcements/**',
78 '**/_*.{js,jsx,ts,tsx,md,mdx}',
79 '**/_*/**',
80 '**/*.test.{js,jsx,ts,tsx}',
81 '**/__tests__/**',
82 ],
83 sidebarPath: './sidebars.js',
84 showLastUpdateTime: true,
85 showLastUpdateAuthor: true,
86 editUrl: ({ docPath }) =>
87 `https://github.com/microsoft/hve-core/tree/main/docs/${docPath}`,
88 remarkPlugins: [remarkGithubAlert],
89 },
90 blog: false,
91 theme: {
92 customCss: './src/css/custom.css',
93 },
94 }),
95 ],
96 ],
97
98 themes: [
99 [
100 '@easyops-cn/docusaurus-search-local',
101 /** @type {import("@easyops-cn/docusaurus-search-local").PluginOptions} */
102 ({
103 hashed: true,
104 language: ['en'],
105 highlightSearchTermsOnTargetPage: true,
106 explicitSearchResultPath: true,
107 }),
108 ],
109 ],
110
111 themeConfig:
112 /** @type {import('@docusaurus/preset-classic').ThemeConfig} */
113 ({
114 image: 'img/microsoft-logo.svg',
115 colorMode: {
116 respectPrefersColorScheme: true,
117 },
118 docs: {
119 sidebar: {
120 hideable: true,
121 autoCollapseCategories: true,
122 },
123 },
124 navbar: {
125 title: 'HVE Core',
126 logo: {
127 alt: 'Microsoft',
128 src: 'img/microsoft-logo.svg',
129 width: 26,
130 height: 26,
131 },
132 items: [
133 {
134 type: 'docSidebar',
135 sidebarId: 'docsSidebar',
136 position: 'left',
137 label: 'Documentation',
138 },
139 {
140 type: 'dropdown',
141 label: 'Topics',
142 position: 'left',
143 items: [
144 { label: 'Get Started', to: '/docs/getting-started/' },
145 { label: 'Workflows', to: '/docs/rpi/' },
146 { label: 'Customize', to: '/docs/customization/' },
147 { label: 'Reference', to: '/docs/architecture/' },
148 ],
149 },
150 {
151 href: 'https://github.com/microsoft/hve-core',
152 label: 'GitHub',
153 position: 'right',
154 },
155 ],
156 },
157 footer: {
158 style: 'dark',
159 links: [
160 {
161 title: 'Documentation',
162 items: [
163 { label: 'Getting Started', to: '/docs/getting-started/' },
164 { label: 'HVE Guide', to: '/docs/hve-guide/' },
165 { label: 'RPI Workflow', to: '/docs/rpi/' },
166 { label: 'Agents', to: '/docs/agents/' },
167 { label: 'Architecture', to: '/docs/architecture/' },
168 ],
169 },
170 {
171 title: 'Resources',
172 items: [
173 { label: 'Contributing', to: '/docs/contributing/' },
174 { label: 'Security', to: '/docs/security/' },
175 { label: 'Templates', to: '/docs/templates/' },
176 ],
177 },
178 {
179 title: 'Community',
180 items: [
181 {
182 label: 'GitHub',
183 href: 'https://github.com/microsoft/hve-core',
184 },
185 ],
186 },
187 ],
188 copyright: `© Microsoft ${new Date().getFullYear()}. Built with HVE.`,
189 },
190 prism: {
191 theme: prismThemes.github,
192 darkTheme: prismThemes.dracula,
193 },
194 }),
195};
196
197export default config;