-
Notifications
You must be signed in to change notification settings - Fork 43
Expand file tree
/
Copy pathdoc-kit.config.mjs
More file actions
37 lines (35 loc) · 1.16 KB
/
doc-kit.config.mjs
File metadata and controls
37 lines (35 loc) · 1.16 KB
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
import web from '@node-core/doc-kit/src/generators/web/index.mjs';
import { join } from 'node:path';
import { populateI18n, createGroupings } from './utils/index.mjs';
import sidebarGroups from './navigation.json' with { type: 'json' };
/** @type {import('@node-core/doc-kit/src/utils/configuration/types.d.ts').Configuration} */
export default {
global: {
output: 'out/learn',
input: ['pages/**/*.md'],
},
web: {
// Important Configuration
project: 'Node.js',
title: '{project} Learn',
pageURL: 'https://nodejs.org/learn{path}.html',
editURL: 'https://github.com/nodejs/learn/edit/main/pages{path}.md',
// Imports
imports: {
...web.defaultConfiguration.imports,
'#theme/Layout': join(import.meta.dirname, 'components/Layout/index.jsx'),
},
virtualImports: {
'#site/navigation.json': JSON.stringify(
populateI18n(
await fetch(
'https://raw.githubusercontent.com/nodejs/nodejs.org/refs/heads/main/apps/site/navigation.json'
).then(r => r.json())
)
),
'#learn/navigation.json': JSON.stringify(
await createGroupings(sidebarGroups)
),
},
},
};