mirror of
https://github.com/pengzhanbo/vuepress-theme-plume.git
synced 2026-04-23 10:58:13 +08:00
2.0 KiB
2.0 KiB
title, author, icon, createTime, permalink, tags
| title | author | icon | createTime | permalink | tags | ||
|---|---|---|---|---|---|---|---|
| 文档/知识笔记 | pengzhanbo | teenyicons:doc-outline | 2024/03/04 15:45:34 | /guide/document/ |
|
概述
在本主题满足了 Blog 的基本功能后,期望能够 以 note 或者 book 的形式聚合文章,形式上类似于 vuepress 默认主题。 同时也减少配置的复杂度。
它能够让你以更加友好的方式,组织管理你的文档。
目录
文档/知识笔记 默认存放在 {sourceDir}/notes 目录下。
示例:
{sourceDir}/
├─ notes/
│ ├─ typescript/
│ │ └─ foo.md
│ └─ rust/
│ └─ foo.md
其中,typescript 和 rust 为目录名,各自独立保存与之相关的 markdown 文件。
配置
import { defineUserConfig } from 'vuepress'
import { plumeTheme } from 'vuepress-theme-plume'
export default defineUserConfig({
theme: plumeTheme({
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 文件,生成 永久链接,以及侧边栏。
::: tip
你应该在创建文件之前,先把笔记的目录和链接前缀等配置好,主题需要根据配置, 为目录中的 md 文件生成永久链接,以及侧边栏。
:::
完整配置查看 notes配置