2024-03-14 04:44:09 +08:00

72 lines
1.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

---
title: 文档/知识笔记
author: pengzhanbo
icon: teenyicons:doc-outline
createTime: 2024/03/04 15:45:34
permalink: /guide/document/
---
## 概述
在本主题满足了 Blog的基本功能后期望能够 以 note 或者 book 的形式聚合文章,形式上类似于 vuepress 默认主题。
同时也减少配置的复杂度。
它能够让你以更加友好的方式,组织管理你的文档,或者 知识笔记。
## 目录
文档/知识笔记 默认存放在 `{sourceDir}/notes` 目录下。
示例:
```
{sourceDir}/
├─ notes/
├─ typescript/
│ ├─ foo.md
├─ rust/
│ ├─ foo.md
```
其中,`typescript``rust` 为目录名,各自独立保存与之相关的 markdown 文件。
## 配置
```js
import { defineUserConfig } from 'vuepress'
import { themePlume } from 'vuepress-theme-plume'
export default defineUserConfig({
theme: themePlume({
notes: {
dir: '/notes/', // 声明所有笔记的目录
link: '/', // 声明所有笔记默认的链接前缀, 默认为 '/'
notes: [
{
dir: 'typescript', // 声明笔记的目录,相对于 `notes.dir`
link: '/typescript/', // 声明笔记的链接前缀
sidebar: [ // 配置侧边栏
{
text: '简介',
icon: 'mdi:language-typescript', // 侧边栏图标
items: ['foo'] // 简化写法,主题会自动补全为 `foo.md`
}
]
},
{
dir: 'rust',
link: '/rust/',
sidebar: [
{ text: '简介', items: ['foo'] }
]
}
]
}
})
})
```
主题会根据配置,为对应目录中的 md 文件,生成 永久链接,以及侧边栏。
完整配置查看 [notes配置](/config/notes/)