-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdefault-config.ts
More file actions
46 lines (45 loc) · 1.04 KB
/
default-config.ts
File metadata and controls
46 lines (45 loc) · 1.04 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
import { defu } from 'defu'
import { type DefaultTheme, defineConfig, type UserConfig } from 'vitepress'
import { groupIconMdPlugin, groupIconVitePlugin } from 'vitepress-plugin-group-icons'
export function defineConfigWithDefaults(opts: {
title: string
description: string
url: string
port: number
/**
* Short format, e.g. `falcondev-oss/caps`
*/
repo: string
config: UserConfig<DefaultTheme.Config>
}) {
return defu(
opts.config,
defineConfig({
title: opts.title,
description: opts.description,
themeConfig: {
socialLinks: [{ icon: 'github', link: `https://github.com/${opts.repo}` }],
logo: '/logo.svg',
},
outDir: 'dist',
cleanUrls: true,
vite: {
server: {
port: opts.port,
},
plugins: [groupIconVitePlugin()],
build: {
minify: false,
},
},
sitemap: {
hostname: opts.url,
},
markdown: {
config(md) {
md.use(groupIconMdPlugin)
},
},
}),
)
}