@fuxishi/vitepress-theme 1.0.1 → 1.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -29
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -8,7 +8,6 @@
|
|
|
8
8
|
- 🎊 **点击彩纸** — 全局点击彩纸特效,金色星星与彩色纸屑
|
|
9
9
|
- ✨ **Feature 光效** — 首页 Feature 卡片鼠标追踪光晕效果
|
|
10
10
|
- 🌈 **彩虹边框** — 暗色模式下代码块 hover 时展示彩虹旋转边框
|
|
11
|
-
- 🚦 **macOS 红绿灯** — 代码块顶部红黄绿交通灯装饰
|
|
12
11
|
- 🔄 **主题切换动画** — View Transition API 实现亮暗模式圆形扩散动画
|
|
13
12
|
- 🎨 **标题装饰** — h1-h4 各有不同颜色的下划线装饰
|
|
14
13
|
- ⚙️ **类型安全** — 完整的 TypeScript 类型定义,IDE 友好
|
|
@@ -32,8 +31,8 @@ npm install vitepress vue element-plus
|
|
|
32
31
|
创建 `.vitepress/theme/index.ts`:
|
|
33
32
|
|
|
34
33
|
```ts
|
|
35
|
-
import FxTheme from
|
|
36
|
-
import
|
|
34
|
+
import FxTheme from "@fuxishi/vitepress-theme"
|
|
35
|
+
import "@fuxishi/vitepress-theme/style.css"
|
|
37
36
|
|
|
38
37
|
export default FxTheme
|
|
39
38
|
```
|
|
@@ -43,29 +42,25 @@ export default FxTheme
|
|
|
43
42
|
创建 `.vitepress/config.mts`:
|
|
44
43
|
|
|
45
44
|
```ts
|
|
46
|
-
import { defineConfigWithTheme } from
|
|
47
|
-
import fxConfig from
|
|
48
|
-
import type { FxThemeConfig } from
|
|
45
|
+
import { defineConfigWithTheme } from "vitepress"
|
|
46
|
+
import fxConfig from "@fuxishi/vitepress-theme/config"
|
|
47
|
+
import type { FxThemeConfig } from "@fuxishi/vitepress-theme/config"
|
|
49
48
|
|
|
50
49
|
export default defineConfigWithTheme<FxThemeConfig>({
|
|
51
50
|
extends: fxConfig,
|
|
52
|
-
lang:
|
|
53
|
-
title:
|
|
51
|
+
lang: "zh-CN",
|
|
52
|
+
title: "我的文档站",
|
|
54
53
|
themeConfig: {
|
|
55
|
-
nav: [
|
|
56
|
-
{ text: '指南', link: '/guide/' },
|
|
57
|
-
],
|
|
54
|
+
nav: [{ text: "指南", link: "/guide/" }],
|
|
58
55
|
sidebar: {
|
|
59
|
-
|
|
60
|
-
{ text: '快速开始', link: '/guide/' },
|
|
61
|
-
],
|
|
56
|
+
"/guide/": [{ text: "快速开始", link: "/guide/" }],
|
|
62
57
|
},
|
|
63
58
|
// 启用音乐球
|
|
64
59
|
musicBall: {
|
|
65
60
|
enable: true,
|
|
66
61
|
autoplay: false,
|
|
67
62
|
loop: true,
|
|
68
|
-
src:
|
|
63
|
+
src: "/music/my-song.mp3",
|
|
69
64
|
},
|
|
70
65
|
// 启用彩纸效果
|
|
71
66
|
confetti: true,
|
|
@@ -85,23 +80,23 @@ npx vitepress dev
|
|
|
85
80
|
|
|
86
81
|
继承自 VitePress `DefaultTheme.Config`,新增以下字段:
|
|
87
82
|
|
|
88
|
-
| 配置项
|
|
89
|
-
|
|
90
|
-
| `musicBall.enable`
|
|
91
|
-
| `musicBall.visible`
|
|
92
|
-
| `musicBall.autoplay` | `boolean`
|
|
93
|
-
| `musicBall.loop`
|
|
94
|
-
| `musicBall.src`
|
|
95
|
-
| `musicBall.list`
|
|
96
|
-
| `confetti`
|
|
83
|
+
| 配置项 | 类型 | 默认值 | 说明 |
|
|
84
|
+
| -------------------- | ------------- | ------- | -------------------- |
|
|
85
|
+
| `musicBall.enable` | `boolean` | `true` | 是否启用音乐球 |
|
|
86
|
+
| `musicBall.visible` | `boolean` | `true` | 是否可见 |
|
|
87
|
+
| `musicBall.autoplay` | `boolean` | `false` | 自动播放 |
|
|
88
|
+
| `musicBall.loop` | `boolean` | `true` | 循环播放(单曲模式) |
|
|
89
|
+
| `musicBall.src` | `string` | `''` | 单首音乐地址 |
|
|
90
|
+
| `musicBall.list` | `MusicItem[]` | — | 多首音乐列表 |
|
|
91
|
+
| `confetti` | `boolean` | `true` | 是否启用点击彩纸效果 |
|
|
97
92
|
|
|
98
93
|
## 导出
|
|
99
94
|
|
|
100
|
-
| 导出路径
|
|
101
|
-
|
|
102
|
-
| `@fuxishi/vitepress-theme`
|
|
103
|
-
| `@fuxishi/vitepress-theme/config`
|
|
104
|
-
| `@fuxishi/vitepress-theme/style.css` | 独立样式文件
|
|
95
|
+
| 导出路径 | 说明 |
|
|
96
|
+
| ------------------------------------ | ---------------------- |
|
|
97
|
+
| `@fuxishi/vitepress-theme` | 主题(Layout + 样式) |
|
|
98
|
+
| `@fuxishi/vitepress-theme/config` | VitePress 基础配置预设 |
|
|
99
|
+
| `@fuxishi/vitepress-theme/style.css` | 独立样式文件 |
|
|
105
100
|
|
|
106
101
|
## 文档
|
|
107
102
|
|
package/package.json
CHANGED