Skip to content

Commit 6282595

Browse files
Add basic vitepress setup
1 parent 90e79b7 commit 6282595

File tree

5 files changed

+2158
-0
lines changed

5 files changed

+2158
-0
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,4 @@
11
docs/_build
2+
node_modules
3+
cache
4+
.vitepress/dist

.vitepress/config.mts

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import { defineConfig } from 'vitepress'
2+
import fs from 'node:fs'
3+
4+
export default async () => {
5+
const files: string[] = await fs.promises.readdir('./docs_md')
6+
7+
// https://vitepress.dev/reference/site-config
8+
return defineConfig({
9+
title: "Nvim Orgmode",
10+
description: "Documentation for Nvim Orgmode",
11+
srcDir: './docs_md',
12+
themeConfig: {
13+
// https://vitepress.dev/reference/default-theme-config
14+
nav: [
15+
{ text: 'Home', link: '/' },
16+
],
17+
18+
sidebar: files.filter(file => file.endsWith('.md')).map((file) => {
19+
const name = file.replace('.md', '')
20+
const text = name.slice(0, 1).toUpperCase() + name.slice(1)
21+
return { text, link: `/${file.replace('.md', '')}` }
22+
}),
23+
24+
socialLinks: [
25+
{ icon: 'github', link: 'https://github.com/nvim-orgmode/orgmode' }
26+
]
27+
},
28+
ignoreDeadLinks: true,
29+
transformHtml(code, id, ctx) {
30+
console.log('id', id)
31+
},
32+
})
33+
34+
}

docs_md/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)