@fuxishi/vitepress-theme 1.0.1 → 1.0.3

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.
Files changed (2) hide show
  1. package/README.md +24 -29
  2. package/package.json +3 -3
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 '@fuxishi/vitepress-theme'
36
- import '@fuxishi/vitepress-theme/style.css'
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 'vitepress'
47
- import fxConfig from '@fuxishi/vitepress-theme/config'
48
- import type { FxThemeConfig } from '@fuxishi/vitepress-theme/config'
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: 'zh-CN',
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
- '/guide/': [
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: '/music/my-song.mp3',
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` | `boolean` | `true` | 是否启用音乐球 |
91
- | `musicBall.visible` | `boolean` | `true` | 是否可见 |
92
- | `musicBall.autoplay` | `boolean` | `false` | 自动播放 |
93
- | `musicBall.loop` | `boolean` | `true` | 循环播放(单曲模式) |
94
- | `musicBall.src` | `string` | `''` | 单首音乐地址 |
95
- | `musicBall.list` | `MusicItem[]` | — | 多首音乐列表 |
96
- | `confetti` | `boolean` | `true` | 是否启用点击彩纸效果 |
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` | 主题(Layout + 样式) |
103
- | `@fuxishi/vitepress-theme/config` | VitePress 基础配置预设 |
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
@@ -2,9 +2,9 @@
2
2
  "name": "@fuxishi/vitepress-theme",
3
3
  "displayName": "@fuxishi/vitepress-theme",
4
4
  "private": false,
5
- "version": "1.0.1",
5
+ "version": "1.0.3",
6
6
  "license": "MIT",
7
- "description": "A beautiful VitePress theme for fx-core documentation.",
7
+ "description": "一款精美的 VitePress 主题",
8
8
  "keywords": [
9
9
  "vitepress",
10
10
  "theme",
@@ -44,7 +44,7 @@
44
44
  "dev": "vite build --watch",
45
45
  "ncu": "ncu -u && npm install",
46
46
  "login": "npm login --registry=https://registry.npmjs.org/",
47
- "publish": "npm publish --access public --registry=https://registry.npmjs.org/"
47
+ "pub": "npm publish --access public --registry=https://registry.npmjs.org/"
48
48
  },
49
49
  "dependencies": {
50
50
  "canvas-confetti": "^1.9.4",