valaxy 0.7.8 → 0.9.0

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 (57) hide show
  1. package/README.md +4 -0
  2. package/client/README.md +3 -0
  3. package/client/components/ValaxyCopyright.vue +1 -1
  4. package/client/components/ValaxyMd.vue +2 -4
  5. package/client/components/ValaxyOverlay.vue +2 -2
  6. package/client/components/ValaxySidebar.vue +1 -2
  7. package/client/composables/category.ts +1 -1
  8. package/client/composables/comments/index.ts +2 -1
  9. package/client/composables/comments/twikoo.ts +1 -1
  10. package/client/composables/comments/waline.ts +3 -2
  11. package/client/composables/common.ts +1 -1
  12. package/client/composables/{copy-code.ts → features/copy-code.ts} +0 -0
  13. package/client/composables/features/index.ts +1 -0
  14. package/client/composables/index.ts +2 -1
  15. package/client/composables/outline.ts +2 -2
  16. package/client/composables/post.ts +1 -1
  17. package/client/composables/tag.ts +1 -1
  18. package/client/composables/widgets/aplayer.ts +1 -1
  19. package/client/config.ts +14 -0
  20. package/client/index.ts +2 -0
  21. package/client/modules/nprogress.ts +1 -1
  22. package/client/modules/pinia.ts +1 -1
  23. package/client/modules/valaxy.ts +2 -2
  24. package/client/scaffolds/post.md +6 -0
  25. package/client/styles/common/code.scss +1 -1
  26. package/client/styles/common/scrollbar.scss +1 -1
  27. package/client/{types.ts → types/index.ts} +0 -0
  28. package/client/utils/time.ts +1 -1
  29. package/dist/{chunk-EYC2AAUG.js → chunk-6SOT7TNG.js} +207 -207
  30. package/dist/{chunk-EIYDDCHI.mjs → chunk-ORY7PPZG.mjs} +207 -207
  31. package/dist/config-60c840d8.d.ts +202 -0
  32. package/dist/node/cli.js +8 -8
  33. package/dist/node/cli.mjs +8 -8
  34. package/dist/node/index.d.ts +147 -14
  35. package/dist/node/index.js +1 -1
  36. package/dist/node/index.mjs +1 -1
  37. package/dist/types/index.d.ts +154 -9
  38. package/dist/types/index.js +1 -1
  39. package/dist/types/index.mjs +0 -1
  40. package/package.json +9 -5
  41. package/types/config.ts +218 -0
  42. package/types/data.ts +31 -0
  43. package/types/index.ts +3 -0
  44. package/types/posts.ts +133 -0
  45. package/client/app/data.ts +0 -0
  46. package/client/components/ValaxyRightSidebar.vue +0 -73
  47. package/client/components/ValaxyToc.vue +0 -140
  48. package/client/modules/README.md +0 -11
  49. package/client/pages/README.md +0 -20
  50. package/dist/chunk-2QVEQP3K.js +0 -1
  51. package/dist/chunk-4FKSRP5I.mjs +0 -0
  52. package/dist/chunk-IMWNMHRD.mjs +0 -0
  53. package/dist/chunk-KP3MIFG6.js +0 -1
  54. package/dist/client/index.d.ts +0 -227
  55. package/dist/client/index.js +0 -1
  56. package/dist/client/index.mjs +0 -1
  57. package/dist/index-328992a1.d.ts +0 -472
@@ -1,30 +1,163 @@
1
- import { U as UserConfig, P as PartialDeep, V as ValaxyConfig, a as ValaxyEntryOptions, b as ValaxyThemeConfig, R as ResolvedValaxyOptions, c as ValaxyServerOptions } from '../index-328992a1.js';
2
- export { R as ResolvedValaxyOptions, a as ValaxyEntryOptions, d as ValaxyPluginOptions, c as ValaxyServerOptions, g as getThemeRoot, i as isPath, r as resolveOptions, e as resolvePluginOptions } from '../index-328992a1.js';
1
+ import { ViteSSGOptions } from 'vite-ssg';
2
+ import Vue from '@vitejs/plugin-vue';
3
+ import Components from 'unplugin-vue-components/vite';
4
+ import { VitePluginConfig } from 'unocss/vite';
5
+ import Pages from 'vite-plugin-pages';
3
6
  import * as vite from 'vite';
4
- import { InlineConfig } from 'vite';
5
- import 'vite-ssg';
6
- import '@vitejs/plugin-vue';
7
- import 'unplugin-vue-components/vite';
8
- import 'unocss/vite';
9
- import 'markdown-it';
10
- import 'shiki';
11
- import 'markdown-it-anchor';
12
- import 'katex';
7
+ import { UserConfig, InlineConfig } from 'vite';
8
+ import { V as ValaxyConfig, U as UserConfig$1, P as PartialDeep, a as ValaxyThemeConfig } from '../config-60c840d8.js';
9
+ import MarkdownIt from 'markdown-it';
10
+ import { Theme } from 'shiki';
11
+ import Anchor from 'markdown-it-anchor';
12
+ import { KatexOptions } from 'katex';
13
+
14
+ interface BlockItem {
15
+ text?: string;
16
+ icon?: string;
17
+ color?: string;
18
+ }
19
+ interface Blocks {
20
+ tip?: BlockItem;
21
+ warning?: BlockItem;
22
+ danger?: BlockItem;
23
+ info?: BlockItem;
24
+ details?: BlockItem;
25
+ }
26
+
27
+ declare type ThemeOptions = Theme | {
28
+ light: Theme;
29
+ dark: Theme;
30
+ };
31
+ interface MarkdownOptions {
32
+ /**
33
+ * markdown-it options
34
+ */
35
+ options?: MarkdownIt.Options;
36
+ /**
37
+ * config markdown-it
38
+ */
39
+ config?: (md: MarkdownIt) => void;
40
+ anchor?: {
41
+ permalink?: Anchor.AnchorOptions['permalink'];
42
+ };
43
+ toc?: {
44
+ includeLevel?: number[];
45
+ [key: string]: any;
46
+ };
47
+ katex?: KatexOptions;
48
+ /**
49
+ * shiki
50
+ */
51
+ theme?: ThemeOptions;
52
+ /**
53
+ * Custom block configurations
54
+ */
55
+ blocks?: Blocks;
56
+ }
57
+
58
+ interface ValaxyEntryOptions {
59
+ /**
60
+ * theme name
61
+ */
62
+ theme?: string;
63
+ userRoot?: string;
64
+ }
65
+ interface ValaxyPluginOptions {
66
+ vue?: Parameters<typeof Vue>[0];
67
+ components?: Parameters<typeof Components>[0];
68
+ unocss?: VitePluginConfig;
69
+ pages?: Parameters<typeof Pages>[0];
70
+ /**
71
+ * for markdown
72
+ */
73
+ markdown?: MarkdownOptions;
74
+ extendMd?: (ctx: {
75
+ route: any;
76
+ data: Record<string, any>;
77
+ excerpt?: string;
78
+ path: string;
79
+ }) => void;
80
+ }
81
+ interface ValaxyThemePlugin extends ValaxyPluginOptions {
82
+ vite?: Omit<UserConfig, 'valaxy'>;
83
+ }
84
+ interface ResolvedValaxyOptions {
85
+ mode: 'dev' | 'build';
86
+ /**
87
+ * package.json root
88
+ */
89
+ pkgRoot: string;
90
+ /**
91
+ * Client root path
92
+ * @default 'valaxy/client'
93
+ */
94
+ clientRoot: string;
95
+ /**
96
+ * User root path
97
+ * @default process.cwd()
98
+ */
99
+ userRoot: string;
100
+ /**
101
+ * Theme root path
102
+ */
103
+ themeRoot: string;
104
+ /**
105
+ * Theme name
106
+ */
107
+ roots: string[];
108
+ theme: string;
109
+ /**
110
+ * Valaxy Config
111
+ */
112
+ config: ValaxyConfig;
113
+ /**
114
+ * config file path
115
+ */
116
+ configFile: string;
117
+ pages: string[];
118
+ }
119
+ interface ValaxyServerOptions {
120
+ onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig) => void;
121
+ }
122
+ declare function isPath(name: string): boolean;
123
+ /**
124
+ * get theme roots
125
+ * @param name
126
+ * @param entry
127
+ * @returns
128
+ */
129
+ declare function getThemeRoot(name: string, entry: string): string;
130
+ declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions>;
131
+
132
+ declare module 'vite' {
133
+ interface UserConfig {
134
+ /**
135
+ * Custom internal plugin options for Valaxy (advanced)
136
+ *
137
+ * @see ./options.ts'
138
+ */
139
+ valaxy?: ValaxyPluginOptions;
140
+ ssgOptions?: ViteSSGOptions;
141
+ }
142
+ }
13
143
 
14
144
  /**
15
145
  * Type config helper
16
146
  */
17
- declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
147
+ declare function defineConfig<ThemeConfig>(config: UserConfig$1<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
18
148
  /**
19
149
  * Type config helper for custom theme config
20
150
  */
21
- declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
151
+ declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig$1<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
22
152
  declare function resolveConfig(options?: ValaxyEntryOptions): Promise<{
23
153
  config: ValaxyConfig<ValaxyThemeConfig>;
24
154
  configFile: string;
25
155
  theme: string;
26
156
  }>;
157
+ declare type ThemeConfigExport = ValaxyThemePlugin | Promise<ValaxyThemePlugin> | ThemeConfigFn;
158
+ declare type ThemeConfigFn = (options: ResolvedValaxyOptions) => ValaxyThemePlugin | Promise<ValaxyThemePlugin>;
159
+ declare function defineThemePlugin(config: ThemeConfigExport): Promise<ValaxyThemePlugin | ThemeConfigFn>;
27
160
 
28
161
  declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
29
162
 
30
- export { createServer, defineConfig, defineConfigWithTheme, resolveConfig };
163
+ export { ResolvedValaxyOptions, ThemeConfigExport, ThemeConfigFn, ValaxyEntryOptions, ValaxyPluginOptions, ValaxyServerOptions, ValaxyThemePlugin, createServer, defineConfig, defineConfigWithTheme, defineThemePlugin, getThemeRoot, isPath, resolveConfig, resolveOptions };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});require('../chunk-KP3MIFG6.js');var _chunkEYC2AAUGjs = require('../chunk-EYC2AAUG.js');exports.createServer = _chunkEYC2AAUGjs.p; exports.defineConfig = _chunkEYC2AAUGjs.e; exports.defineConfigWithTheme = _chunkEYC2AAUGjs.f; exports.getThemeRoot = _chunkEYC2AAUGjs.j; exports.isPath = _chunkEYC2AAUGjs.i; exports.resolveConfig = _chunkEYC2AAUGjs.g; exports.resolveOptions = _chunkEYC2AAUGjs.k; exports.resolvePluginOptions = _chunkEYC2AAUGjs.l;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunk6SOT7TNGjs = require('../chunk-6SOT7TNG.js');exports.createServer = _chunk6SOT7TNGjs.p; exports.defineConfig = _chunk6SOT7TNGjs.e; exports.defineConfigWithTheme = _chunk6SOT7TNGjs.f; exports.defineThemePlugin = _chunk6SOT7TNGjs.h; exports.getThemeRoot = _chunk6SOT7TNGjs.k; exports.isPath = _chunk6SOT7TNGjs.j; exports.resolveConfig = _chunk6SOT7TNGjs.g; exports.resolveOptions = _chunk6SOT7TNGjs.l;
@@ -1 +1 @@
1
- import"../chunk-4FKSRP5I.mjs";import{e as a,f as b,g as c,i as d,j as e,k as f,l as g,p as h}from"../chunk-EIYDDCHI.mjs";export{h as createServer,a as defineConfig,b as defineConfigWithTheme,e as getThemeRoot,d as isPath,c as resolveConfig,f as resolveOptions,g as resolvePluginOptions};
1
+ import{e as o,f as r,g as m,h as p,j as t,k as e,l as f,p as x}from"../chunk-ORY7PPZG.mjs";export{x as createServer,o as defineConfig,r as defineConfigWithTheme,p as defineThemePlugin,e as getThemeRoot,t as isPath,m as resolveConfig,f as resolveOptions};
@@ -1,9 +1,154 @@
1
- import 'vite-ssg';
2
- export { A as AlgoliaSearchOptions, k as HeadConfig, H as Header, h as PageData, j as PageDataPayload, P as PartialDeep, f as Post, S as SocialLink, U as UserConfig, V as ValaxyConfig, b as ValaxyThemeConfig } from '../index-328992a1.js';
3
- import '@vitejs/plugin-vue';
4
- import 'unplugin-vue-components/vite';
5
- import 'unocss/vite';
6
- import 'markdown-it';
7
- import 'shiki';
8
- import 'markdown-it-anchor';
9
- import 'katex';
1
+ export { A as AlgoliaSearchOptions, P as PartialDeep, S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig } from '../config-60c840d8.js';
2
+
3
+ interface Post extends Record<string, any> {
4
+ /**
5
+ * Path of post
6
+ * route.path
7
+ * @description 路径
8
+ */
9
+ path?: string;
10
+ /**
11
+ * Title
12
+ * @description 文章标题
13
+ */
14
+ title?: string;
15
+ date?: string | number | Date;
16
+ /**
17
+ * Updated Time
18
+ */
19
+ updated?: string | number | Date;
20
+ lang?: string;
21
+ /**
22
+ * TODO
23
+ * Read Time
24
+ * @description 阅读时长
25
+ */
26
+ duration?: string;
27
+ /**
28
+ * post card type, can be bilibili/yuque/...
29
+ */
30
+ type?: string;
31
+ /**
32
+ * override url, and jump directly
33
+ */
34
+ url?: string;
35
+ /**
36
+ * @description 摘要
37
+ */
38
+ excerpt?: string;
39
+ /**
40
+ * @description Author
41
+ * @description:zh-CN 作者
42
+ */
43
+ author?: string;
44
+ /**
45
+ * Display sponsor info
46
+ * @description 是否开启赞助
47
+ */
48
+ sponsor?: boolean;
49
+ /**
50
+ * Copyright
51
+ * @description 是否显示文章底部版权信息
52
+ */
53
+ copyright?: boolean;
54
+ /**
55
+ * Category
56
+ * @description 分类,若为数组,则按顺序代表多层文件夹
57
+ */
58
+ categories?: string | string[];
59
+ /**
60
+ * Tags
61
+ * @description 标签,可以有多个
62
+ */
63
+ tags?: string[];
64
+ /**
65
+ * display prev next
66
+ * @description 是否显示前一篇、后一篇导航
67
+ */
68
+ nav?: boolean;
69
+ /**
70
+ * display right sidebar
71
+ * @description 是否显示右侧侧边栏
72
+ */
73
+ aside?: boolean;
74
+ /**
75
+ * icon before title
76
+ */
77
+ icon?: string;
78
+ /**
79
+ * title color
80
+ */
81
+ color?: string;
82
+ /**
83
+ * display comment
84
+ */
85
+ comment?: boolean;
86
+ /**
87
+ * post is end
88
+ * @description 是否完结,将在末尾添加衬线字体 Q.E.D.
89
+ */
90
+ end?: boolean;
91
+ /**
92
+ * use aplayer
93
+ */
94
+ aplayer?: boolean;
95
+ /**
96
+ * use katex
97
+ */
98
+ katex?: boolean;
99
+ /**
100
+ * use codepen
101
+ */
102
+ codepen?: boolean;
103
+ /**
104
+ * 置顶
105
+ */
106
+ top?: number;
107
+ /**
108
+ * display toc
109
+ * @description 是否显示目录
110
+ */
111
+ toc?: boolean;
112
+ /**
113
+ * is draft
114
+ * @description 是否为草稿
115
+ */
116
+ draft?: boolean;
117
+ /**
118
+ * cover
119
+ * @description 封面图片
120
+ */
121
+ cover?: string;
122
+ /**
123
+ * enable markdown-body class
124
+ * @description 是否启用默认的 markdown 样式
125
+ */
126
+ markdown?: boolean;
127
+ }
128
+
129
+ interface Header {
130
+ level: number;
131
+ title: string;
132
+ slug: string;
133
+ /**
134
+ * i18n
135
+ */
136
+ lang?: string;
137
+ }
138
+ interface PageData {
139
+ path: string;
140
+ relativePath: string;
141
+ title: string;
142
+ titleTemplate?: string;
143
+ description: string;
144
+ headers: Header[];
145
+ frontmatter: Post;
146
+ lastUpdated?: number;
147
+ }
148
+ interface PageDataPayload {
149
+ path: string;
150
+ pageData: PageData;
151
+ }
152
+ declare type HeadConfig = [string, Record<string, string>] | [string, Record<string, string>, string];
153
+
154
+ export { HeadConfig, Header, PageData, PageDataPayload, Post };
@@ -1 +1 @@
1
- "use strict";require('../chunk-2QVEQP3K.js');
1
+ "use strict";
@@ -1 +0,0 @@
1
- import"../chunk-IMWNMHRD.mjs";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy",
3
- "version": "0.7.8",
3
+ "version": "0.9.0",
4
4
  "description": "📄 Vite & Vue powered static blog generator.",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -22,7 +22,11 @@
22
22
  "import": "./dist/node/index.mjs"
23
23
  },
24
24
  "./client/*": "./client/*",
25
- "./client": "./dist/client/index.d.ts",
25
+ "./client": {
26
+ "types": "./dist/client/index.d.ts",
27
+ "require": "./dist/client/index.js",
28
+ "import": "./dist/client/index.mjs"
29
+ },
26
30
  "./node": {
27
31
  "types": "./dist/node/index.d.ts",
28
32
  "require": "./dist/node/index.js",
@@ -42,7 +46,8 @@
42
46
  "index.d.ts",
43
47
  "bin",
44
48
  "dist",
45
- "client"
49
+ "client",
50
+ "types"
46
51
  ],
47
52
  "engines": {
48
53
  "node": ">=14.0.0"
@@ -84,10 +89,9 @@
84
89
  "shiki": "^0.10.1",
85
90
  "star-markdown-css": "^0.4.0",
86
91
  "unconfig": "^0.3.5",
87
- "unocss": "^0.43.2",
92
+ "unocss": "^0.44.0",
88
93
  "unplugin-vue-components": "^0.21.1",
89
94
  "vite": "^2.9.14",
90
- "vite-plugin-inspect": "^0.5.1",
91
95
  "vite-plugin-pages": "^0.25.0",
92
96
  "vite-plugin-vue-layouts": "^0.6.0",
93
97
  "vite-ssg": "0.19.2",
@@ -0,0 +1,218 @@
1
+ export type ValaxyThemeConfig = Record<string, any>
2
+
3
+ export interface SocialLink {
4
+ /**
5
+ * The title of your link
6
+ */
7
+ name: string
8
+ link: string
9
+ /**
10
+ * 图标名称
11
+ * https://icones.js.org/
12
+ */
13
+ icon: string
14
+ color: string
15
+ }
16
+
17
+ export interface AlgoliaSearchOptions {
18
+ enable: boolean
19
+ appId: string
20
+ apiKey: string
21
+ indexName: string
22
+ placeholder?: string
23
+ searchParameters?: any
24
+ disableUserPersonalization?: boolean
25
+ initialQuery?: string
26
+ }
27
+
28
+ // packages/valaxy/node/config.ts
29
+ export interface ValaxyConfig<T = ValaxyThemeConfig> {
30
+ /**
31
+ * Default language
32
+ * @description 默认语言
33
+ * @default 'en'
34
+ */
35
+ lang: string
36
+ /**
37
+ * You site url in web, required for ssg & rss
38
+ * @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
39
+ * @default '/'
40
+ */
41
+ url: string
42
+ /**
43
+ * Site title
44
+ * @description 站点标题
45
+ */
46
+ title: string
47
+ /**
48
+ * 副标题
49
+ */
50
+ subtitle: string
51
+ /**
52
+ * 站点描述
53
+ */
54
+ description: string
55
+ /**
56
+ * The owner of this blog
57
+ * @description 博客作者
58
+ */
59
+ author: {
60
+ /**
61
+ * Your name
62
+ * @description 你的名字
63
+ */
64
+ name: string
65
+ email: string
66
+ link: string
67
+ avatar: string
68
+ /**
69
+ * The status of you
70
+ * @description 状态
71
+ */
72
+ status: {
73
+ emoji: string
74
+ /**
75
+ * show when hover emoji
76
+ * @description 当鼠标悬浮在图标上时显示
77
+ */
78
+ message: string
79
+ }
80
+ }
81
+
82
+ /**
83
+ * show last updated time by git
84
+ */
85
+ lastUpdated: boolean
86
+
87
+ /**
88
+ * icon for your website
89
+ */
90
+ favicon: string
91
+
92
+ feed: {
93
+ /**
94
+ * name: feed -> feed.xml / feed.atom / feed.json
95
+ * @default '' -> feed.xml / atom.xml / feed.json
96
+ */
97
+ name: string
98
+ favicon: string
99
+ }
100
+
101
+ /**
102
+ * 社交链接
103
+ */
104
+ social: SocialLink[]
105
+
106
+ /**
107
+ * search
108
+ */
109
+ search: {
110
+ enable: boolean
111
+ algolia: AlgoliaSearchOptions
112
+ }
113
+
114
+ /**
115
+ * comment: waline/...
116
+ */
117
+ comment: {
118
+ enable: boolean
119
+ waline: {
120
+ enable: boolean
121
+ serverURL: string
122
+ }
123
+ twikoo: {
124
+ enable: boolean
125
+ envId: string
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Markdown Feature
131
+ */
132
+ features: {
133
+ /**
134
+ * enable katex for global
135
+ */
136
+ katex: boolean
137
+ }
138
+
139
+ /**
140
+ * third-party plugin need cdn
141
+ * aplayer, twikoo
142
+ * @default 'https://npm.elemecdn.com/'
143
+ */
144
+ cdn: {
145
+ prefix: string
146
+ }
147
+
148
+ /**
149
+ * The name of theme
150
+ * @description 主题名称
151
+ */
152
+ theme: string
153
+ /**
154
+ * The config of theme
155
+ * @description 主题配置
156
+ */
157
+ themeConfig: T & {
158
+ pkg: {
159
+ name: string
160
+ version: string
161
+ homepage?: string
162
+ [key: string]: any
163
+ }
164
+ }
165
+
166
+ /**
167
+ * The license of your posts
168
+ * @description 文章所使用的协议,默认使用 Creative Commons
169
+ * @default https://creativecommons.org/licenses/
170
+ */
171
+ license: {
172
+ /**
173
+ * Whether to show at the bottom of the article
174
+ * @description 是否显示在文章底部
175
+ * @default true
176
+ */
177
+ enabled: boolean
178
+ /**
179
+ * Creative License Language, same with your config.lang
180
+ * when lang === 'zh-CN', use 'zh'
181
+ * @description 默认与站点语言相同
182
+ * @default 'en'
183
+ */
184
+ language: string
185
+ /**
186
+ * Type of license
187
+ * @description 证书类型
188
+ * @default 'by-nc-sa'
189
+ */
190
+ type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd'
191
+ }
192
+
193
+ /**
194
+ * donate for author
195
+ * @description 打赏/赞助
196
+ */
197
+ sponsor: {
198
+ enable: boolean
199
+ title: string
200
+ methods: {
201
+ name: string
202
+ url: string
203
+ color: string
204
+ icon: string
205
+ }[]
206
+ }
207
+ }
208
+
209
+ export type PartialDeep<T> = {
210
+ [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P]
211
+ }
212
+
213
+ /**
214
+ * Valaxy User Config
215
+ * @description Valaxy 用户配置
216
+ */
217
+ export type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>
218
+
package/types/data.ts ADDED
@@ -0,0 +1,31 @@
1
+ import type { Post } from './posts'
2
+
3
+ export interface Header {
4
+ level: number
5
+ title: string
6
+ slug: string
7
+ /**
8
+ * i18n
9
+ */
10
+ lang?: string
11
+ }
12
+
13
+ export interface PageData {
14
+ path: string
15
+ relativePath: string
16
+ title: string
17
+ titleTemplate?: string
18
+ description: string
19
+ headers: Header[]
20
+ frontmatter: Post
21
+ lastUpdated?: number
22
+ }
23
+
24
+ export interface PageDataPayload {
25
+ path: string
26
+ pageData: PageData
27
+ }
28
+
29
+ export type HeadConfig =
30
+ | [string, Record<string, string>]
31
+ | [string, Record<string, string>, string]
package/types/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './config'
2
+ export * from './data'
3
+ export * from './posts'