-
Notifications
You must be signed in to change notification settings - Fork 93
Expand file tree
/
Copy pathsource.config.ts
More file actions
52 lines (50 loc) · 1.52 KB
/
Copy pathsource.config.ts
File metadata and controls
52 lines (50 loc) · 1.52 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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import path from 'node:path';
import {
createBlogCollection,
createDirectDocsWorkspaceModule,
createDocsCollection,
createDocsWorkspaceModule,
createGlobalConfig,
} from './lib/fumadocs-config';
import {
enabledExternalDocsSources,
getDocsSourceGitRef,
getDocsSourceRepo,
getDocsSourceSubpath,
getProjectDocsDir,
} from './lib/docs-sources';
import {
getProjectCheckoutDir,
getWorkspaceProjectCheckoutDir,
} from './lib/docs-workspaces';
export const docs = createDocsCollection('content/docs');
export const blogPosts = createBlogCollection('content/blog');
export default createGlobalConfig({
workspaces: Object.fromEntries(
enabledExternalDocsSources.map((sourceConfig) => [
sourceConfig.package,
{
dir:
sourceConfig.mode === 'workspace'
? path.join(
getWorkspaceProjectCheckoutDir(
getDocsSourceRepo(sourceConfig.source),
getDocsSourceGitRef(sourceConfig),
),
getDocsSourceSubpath(sourceConfig.source),
)
: getProjectCheckoutDir(sourceConfig.package, sourceConfig.mode),
config:
sourceConfig.mode === 'workspace'
? createDirectDocsWorkspaceModule(
'.',
sourceConfig.include,
sourceConfig.mounts?.map(
(mount) => `${mount.source}/**/*.{json,yaml,yml}`,
),
)
: createDocsWorkspaceModule(getProjectDocsDir()),
},
]),
),
});