valaxy 0.7.7 → 0.8.1
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 +4 -0
- package/client/README.md +3 -0
- package/client/components/ValaxyCopyright.vue +1 -1
- package/client/components/ValaxyMd.vue +2 -4
- package/client/components/ValaxyOverlay.vue +2 -2
- package/client/components/ValaxySidebar.vue +1 -2
- package/client/composables/comments/twikoo.ts +25 -1
- package/client/composables/comments/waline.ts +33 -23
- package/client/composables/{copy-code.ts → features/copy-code.ts} +0 -0
- package/client/composables/features/index.ts +1 -0
- package/client/composables/index.ts +2 -1
- package/client/composables/outline.ts +1 -1
- package/client/composables/post.ts +1 -1
- package/client/composables/widgets/aplayer.ts +10 -5
- package/client/config.ts +4 -1
- package/client/index.ts +2 -0
- package/client/modules/nprogress.ts +1 -1
- package/client/modules/pinia.ts +1 -1
- package/client/modules/valaxy.ts +1 -1
- package/client/scaffolds/post.md +6 -0
- package/client/styles/common/code.scss +1 -1
- package/client/styles/common/scrollbar.scss +1 -1
- package/client/{types.ts → types/index.ts} +0 -0
- package/client/utils/cdn.ts +1 -0
- package/client/utils/index.ts +1 -0
- package/dist/{chunk-HP2UOVSL.mjs → chunk-ER6SQ4ZW.mjs} +204 -204
- package/dist/{chunk-BTP4CLJN.js → chunk-VGABMGJA.js} +203 -203
- package/dist/config-60c840d8.d.ts +202 -0
- package/dist/node/cli.js +11 -11
- package/dist/node/cli.mjs +11 -11
- package/dist/node/index.d.ts +140 -15
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +154 -10
- package/index.d.ts +1 -1
- package/package.json +14 -8
- package/types/config.ts +218 -0
- package/types/data.ts +31 -0
- package/types/index.ts +3 -0
- package/types/posts.ts +133 -0
- package/client/app/data.ts +0 -0
- package/client/components/ValaxyRightSidebar.vue +0 -73
- package/client/components/ValaxyToc.vue +0 -140
- package/client/modules/README.md +0 -11
- package/client/pages/README.md +0 -20
- package/client/shims.d.ts +0 -42
- package/dist/index-df14d281.d.ts +0 -462
package/dist/index-df14d281.d.ts
DELETED
|
@@ -1,462 +0,0 @@
|
|
|
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 { PartialDeep } from 'type-fest';
|
|
6
|
-
import MarkdownIt from 'markdown-it';
|
|
7
|
-
import { Theme } from 'shiki';
|
|
8
|
-
import Anchor from 'markdown-it-anchor';
|
|
9
|
-
import { KatexOptions } from 'katex';
|
|
10
|
-
|
|
11
|
-
interface ValaxyEntryOptions {
|
|
12
|
-
/**
|
|
13
|
-
* theme name
|
|
14
|
-
*/
|
|
15
|
-
theme?: string;
|
|
16
|
-
userRoot?: string;
|
|
17
|
-
}
|
|
18
|
-
interface ValaxyPluginOptions {
|
|
19
|
-
vue?: Parameters<typeof Vue>[0];
|
|
20
|
-
components?: Parameters<typeof Components>[0];
|
|
21
|
-
unocss?: VitePluginConfig;
|
|
22
|
-
}
|
|
23
|
-
interface ResolvedValaxyOptions {
|
|
24
|
-
mode: 'dev' | 'build';
|
|
25
|
-
/**
|
|
26
|
-
* Client root path
|
|
27
|
-
* @default 'valaxy/client'
|
|
28
|
-
*/
|
|
29
|
-
clientRoot: string;
|
|
30
|
-
/**
|
|
31
|
-
* User root path
|
|
32
|
-
* @default process.cwd()
|
|
33
|
-
*/
|
|
34
|
-
userRoot: string;
|
|
35
|
-
/**
|
|
36
|
-
* Theme root path
|
|
37
|
-
*/
|
|
38
|
-
themeRoot: string;
|
|
39
|
-
/**
|
|
40
|
-
* Theme name
|
|
41
|
-
*/
|
|
42
|
-
roots: string[];
|
|
43
|
-
theme: string;
|
|
44
|
-
/**
|
|
45
|
-
* Valaxy Config
|
|
46
|
-
*/
|
|
47
|
-
config: ValaxyConfig;
|
|
48
|
-
/**
|
|
49
|
-
* config file path
|
|
50
|
-
*/
|
|
51
|
-
configFile: string;
|
|
52
|
-
pages: string[];
|
|
53
|
-
}
|
|
54
|
-
interface ValaxyServerOptions {
|
|
55
|
-
onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig) => void;
|
|
56
|
-
}
|
|
57
|
-
declare function isPath(name: string): boolean;
|
|
58
|
-
/**
|
|
59
|
-
* get theme roots
|
|
60
|
-
* @param name
|
|
61
|
-
* @param entry
|
|
62
|
-
* @returns
|
|
63
|
-
*/
|
|
64
|
-
declare function getThemeRoot(name: string, entry: string): string;
|
|
65
|
-
declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions>;
|
|
66
|
-
/**
|
|
67
|
-
* resolve plugin options
|
|
68
|
-
* @param command
|
|
69
|
-
* @returns
|
|
70
|
-
*/
|
|
71
|
-
declare function resolvePluginOptions(command?: 'build' | 'serve'): Promise<ValaxyPluginOptions>;
|
|
72
|
-
|
|
73
|
-
interface BlockItem {
|
|
74
|
-
text?: string;
|
|
75
|
-
icon?: string;
|
|
76
|
-
color?: string;
|
|
77
|
-
}
|
|
78
|
-
interface Blocks {
|
|
79
|
-
tip?: BlockItem;
|
|
80
|
-
warning?: BlockItem;
|
|
81
|
-
danger?: BlockItem;
|
|
82
|
-
info?: BlockItem;
|
|
83
|
-
details?: BlockItem;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
declare type ThemeOptions = Theme | {
|
|
87
|
-
light: Theme;
|
|
88
|
-
dark: Theme;
|
|
89
|
-
};
|
|
90
|
-
interface MarkdownOptions extends MarkdownIt.Options {
|
|
91
|
-
config?: (md: MarkdownIt) => void;
|
|
92
|
-
anchor?: {
|
|
93
|
-
permalink?: Anchor.AnchorOptions['permalink'];
|
|
94
|
-
};
|
|
95
|
-
toc?: {
|
|
96
|
-
includeLevel?: number[];
|
|
97
|
-
[key: string]: any;
|
|
98
|
-
};
|
|
99
|
-
katex?: KatexOptions;
|
|
100
|
-
/**
|
|
101
|
-
* shiki
|
|
102
|
-
*/
|
|
103
|
-
theme?: ThemeOptions;
|
|
104
|
-
/**
|
|
105
|
-
* Custom block configurations
|
|
106
|
-
*/
|
|
107
|
-
blocks?: Blocks;
|
|
108
|
-
}
|
|
109
|
-
|
|
110
|
-
declare type ValaxyThemeConfig = Record<string, any>;
|
|
111
|
-
interface SocialLink {
|
|
112
|
-
/**
|
|
113
|
-
* The title of your link
|
|
114
|
-
*/
|
|
115
|
-
name: string;
|
|
116
|
-
link: string;
|
|
117
|
-
/**
|
|
118
|
-
* 图标名称
|
|
119
|
-
* https://icones.js.org/
|
|
120
|
-
*/
|
|
121
|
-
icon: string;
|
|
122
|
-
color: string;
|
|
123
|
-
}
|
|
124
|
-
interface AlgoliaSearchOptions {
|
|
125
|
-
enable: boolean;
|
|
126
|
-
appId: string;
|
|
127
|
-
apiKey: string;
|
|
128
|
-
indexName: string;
|
|
129
|
-
placeholder?: string;
|
|
130
|
-
searchParameters?: any;
|
|
131
|
-
disableUserPersonalization?: boolean;
|
|
132
|
-
initialQuery?: string;
|
|
133
|
-
}
|
|
134
|
-
interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
135
|
-
/**
|
|
136
|
-
* Default language
|
|
137
|
-
* @description 默认语言
|
|
138
|
-
* @default 'en'
|
|
139
|
-
*/
|
|
140
|
-
lang: string;
|
|
141
|
-
/**
|
|
142
|
-
* You site url in web, required for ssg & rss
|
|
143
|
-
* @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
144
|
-
* @default '/'
|
|
145
|
-
*/
|
|
146
|
-
url: string;
|
|
147
|
-
/**
|
|
148
|
-
* Site title
|
|
149
|
-
* @description 站点标题
|
|
150
|
-
*/
|
|
151
|
-
title: string;
|
|
152
|
-
/**
|
|
153
|
-
* 副标题
|
|
154
|
-
*/
|
|
155
|
-
subtitle: string;
|
|
156
|
-
/**
|
|
157
|
-
* 站点描述
|
|
158
|
-
*/
|
|
159
|
-
description: string;
|
|
160
|
-
/**
|
|
161
|
-
* The owner of this blog
|
|
162
|
-
* @description 博客作者
|
|
163
|
-
*/
|
|
164
|
-
author: {
|
|
165
|
-
/**
|
|
166
|
-
* Your name
|
|
167
|
-
* @description 你的名字
|
|
168
|
-
*/
|
|
169
|
-
name: string;
|
|
170
|
-
email: string;
|
|
171
|
-
link: string;
|
|
172
|
-
avatar: string;
|
|
173
|
-
/**
|
|
174
|
-
* The status of you
|
|
175
|
-
* @description 状态
|
|
176
|
-
*/
|
|
177
|
-
status: {
|
|
178
|
-
emoji: string;
|
|
179
|
-
/**
|
|
180
|
-
* show when hover emoji
|
|
181
|
-
* @description 当鼠标悬浮在图标上时显示
|
|
182
|
-
*/
|
|
183
|
-
message: string;
|
|
184
|
-
};
|
|
185
|
-
};
|
|
186
|
-
/**
|
|
187
|
-
* show last updated time by git
|
|
188
|
-
*/
|
|
189
|
-
lastUpdated: boolean;
|
|
190
|
-
/**
|
|
191
|
-
* icon for your website
|
|
192
|
-
*/
|
|
193
|
-
favicon: string;
|
|
194
|
-
feed: {
|
|
195
|
-
/**
|
|
196
|
-
* name: feed -> feed.xml / feed.atom / feed.json
|
|
197
|
-
* @default '' -> feed.xml / atom.xml / feed.json
|
|
198
|
-
*/
|
|
199
|
-
name: string;
|
|
200
|
-
favicon: string;
|
|
201
|
-
};
|
|
202
|
-
/**
|
|
203
|
-
* 社交链接
|
|
204
|
-
*/
|
|
205
|
-
social: SocialLink[];
|
|
206
|
-
/**
|
|
207
|
-
* search
|
|
208
|
-
*/
|
|
209
|
-
search: {
|
|
210
|
-
enable: boolean;
|
|
211
|
-
algolia: AlgoliaSearchOptions;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* comment: waline/...
|
|
215
|
-
*/
|
|
216
|
-
comment: {
|
|
217
|
-
enable: boolean;
|
|
218
|
-
waline: {
|
|
219
|
-
enable: boolean;
|
|
220
|
-
serverURL: string;
|
|
221
|
-
};
|
|
222
|
-
twikoo: {
|
|
223
|
-
enable: boolean;
|
|
224
|
-
envId: string;
|
|
225
|
-
};
|
|
226
|
-
};
|
|
227
|
-
/**
|
|
228
|
-
* Markdown Feature
|
|
229
|
-
*/
|
|
230
|
-
features: {
|
|
231
|
-
/**
|
|
232
|
-
* enable katex for global
|
|
233
|
-
*/
|
|
234
|
-
katex: boolean;
|
|
235
|
-
};
|
|
236
|
-
/**
|
|
237
|
-
* The name of theme
|
|
238
|
-
* @description 主题名称
|
|
239
|
-
*/
|
|
240
|
-
theme: string;
|
|
241
|
-
/**
|
|
242
|
-
* The config of theme
|
|
243
|
-
* @description 主题配置
|
|
244
|
-
*/
|
|
245
|
-
themeConfig: T & {
|
|
246
|
-
pkg: {
|
|
247
|
-
name: string;
|
|
248
|
-
version: string;
|
|
249
|
-
homepage?: string;
|
|
250
|
-
[key: string]: any;
|
|
251
|
-
};
|
|
252
|
-
};
|
|
253
|
-
/**
|
|
254
|
-
* The license of your posts
|
|
255
|
-
* @description 文章所使用的协议,默认使用 Creative Commons
|
|
256
|
-
* @default https://creativecommons.org/licenses/
|
|
257
|
-
*/
|
|
258
|
-
license: {
|
|
259
|
-
/**
|
|
260
|
-
* Whether to show at the bottom of the article
|
|
261
|
-
* @description 是否显示在文章底部
|
|
262
|
-
* @default true
|
|
263
|
-
*/
|
|
264
|
-
enabled: boolean;
|
|
265
|
-
/**
|
|
266
|
-
* Creative License Language, same with your config.lang
|
|
267
|
-
* when lang === 'zh-CN', use 'zh'
|
|
268
|
-
* @description 默认与站点语言相同
|
|
269
|
-
* @default 'en'
|
|
270
|
-
*/
|
|
271
|
-
language: string;
|
|
272
|
-
/**
|
|
273
|
-
* Type of license
|
|
274
|
-
* @description 证书类型
|
|
275
|
-
* @default 'by-nc-sa'
|
|
276
|
-
*/
|
|
277
|
-
type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
|
|
278
|
-
};
|
|
279
|
-
/**
|
|
280
|
-
* donate for author
|
|
281
|
-
* @description 打赏/赞助
|
|
282
|
-
*/
|
|
283
|
-
sponsor: {
|
|
284
|
-
enable: boolean;
|
|
285
|
-
title: string;
|
|
286
|
-
methods: {
|
|
287
|
-
name: string;
|
|
288
|
-
url: string;
|
|
289
|
-
color: string;
|
|
290
|
-
icon: string;
|
|
291
|
-
}[];
|
|
292
|
-
};
|
|
293
|
-
/**
|
|
294
|
-
* for markdown
|
|
295
|
-
*/
|
|
296
|
-
markdownIt: MarkdownOptions;
|
|
297
|
-
}
|
|
298
|
-
/**
|
|
299
|
-
* Valaxy User Config
|
|
300
|
-
* @description Valaxy 用户配置
|
|
301
|
-
*/
|
|
302
|
-
declare type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>;
|
|
303
|
-
|
|
304
|
-
interface Post extends Record<string, any> {
|
|
305
|
-
/**
|
|
306
|
-
* Path of post
|
|
307
|
-
* route.path
|
|
308
|
-
* @description 路径
|
|
309
|
-
*/
|
|
310
|
-
path?: string;
|
|
311
|
-
/**
|
|
312
|
-
* Title
|
|
313
|
-
* @description 文章标题
|
|
314
|
-
*/
|
|
315
|
-
title?: string;
|
|
316
|
-
date?: string | number | Date;
|
|
317
|
-
/**
|
|
318
|
-
* Updated Time
|
|
319
|
-
*/
|
|
320
|
-
updated?: string | number | Date;
|
|
321
|
-
lang?: string;
|
|
322
|
-
/**
|
|
323
|
-
* TODO
|
|
324
|
-
* Read Time
|
|
325
|
-
* @description 阅读时长
|
|
326
|
-
*/
|
|
327
|
-
duration?: string;
|
|
328
|
-
/**
|
|
329
|
-
* post card type, can be bilibili/yuque/...
|
|
330
|
-
*/
|
|
331
|
-
type?: string;
|
|
332
|
-
/**
|
|
333
|
-
* override url, and jump directly
|
|
334
|
-
*/
|
|
335
|
-
url?: string;
|
|
336
|
-
/**
|
|
337
|
-
* @description 摘要
|
|
338
|
-
*/
|
|
339
|
-
excerpt?: string;
|
|
340
|
-
/**
|
|
341
|
-
* @description Author
|
|
342
|
-
* @description:zh-CN 作者
|
|
343
|
-
*/
|
|
344
|
-
author?: string;
|
|
345
|
-
/**
|
|
346
|
-
* Display sponsor info
|
|
347
|
-
* @description 是否开启赞助
|
|
348
|
-
*/
|
|
349
|
-
sponsor?: boolean;
|
|
350
|
-
/**
|
|
351
|
-
* Copyright
|
|
352
|
-
* @description 是否显示文章底部版权信息
|
|
353
|
-
*/
|
|
354
|
-
copyright?: boolean;
|
|
355
|
-
/**
|
|
356
|
-
* Category
|
|
357
|
-
* @description 分类,若为数组,则按顺序代表多层文件夹
|
|
358
|
-
*/
|
|
359
|
-
categories?: string | string[];
|
|
360
|
-
/**
|
|
361
|
-
* Tags
|
|
362
|
-
* @description 标签,可以有多个
|
|
363
|
-
*/
|
|
364
|
-
tags?: string[];
|
|
365
|
-
/**
|
|
366
|
-
* display prev next
|
|
367
|
-
* @description 是否显示前一篇、后一篇导航
|
|
368
|
-
*/
|
|
369
|
-
nav?: boolean;
|
|
370
|
-
/**
|
|
371
|
-
* icon before title
|
|
372
|
-
*/
|
|
373
|
-
icon?: string;
|
|
374
|
-
/**
|
|
375
|
-
* title color
|
|
376
|
-
*/
|
|
377
|
-
color?: string;
|
|
378
|
-
/**
|
|
379
|
-
* display comment
|
|
380
|
-
*/
|
|
381
|
-
comment?: boolean;
|
|
382
|
-
/**
|
|
383
|
-
* post is end
|
|
384
|
-
* @description 是否完结,将在末尾添加衬线字体 Q.E.D.
|
|
385
|
-
*/
|
|
386
|
-
end?: boolean;
|
|
387
|
-
/**
|
|
388
|
-
* use aplayer
|
|
389
|
-
*/
|
|
390
|
-
aplayer?: boolean;
|
|
391
|
-
/**
|
|
392
|
-
* use katex
|
|
393
|
-
*/
|
|
394
|
-
katex?: boolean;
|
|
395
|
-
/**
|
|
396
|
-
* use codepen
|
|
397
|
-
*/
|
|
398
|
-
codepen?: boolean;
|
|
399
|
-
/**
|
|
400
|
-
* 置顶
|
|
401
|
-
*/
|
|
402
|
-
top?: number;
|
|
403
|
-
/**
|
|
404
|
-
* display toc
|
|
405
|
-
* @description 是否显示目录
|
|
406
|
-
*/
|
|
407
|
-
toc?: boolean;
|
|
408
|
-
/**
|
|
409
|
-
* is draft
|
|
410
|
-
* @description 是否为草稿
|
|
411
|
-
*/
|
|
412
|
-
draft?: boolean;
|
|
413
|
-
/**
|
|
414
|
-
* cover
|
|
415
|
-
* @description 封面图片
|
|
416
|
-
*/
|
|
417
|
-
cover?: string;
|
|
418
|
-
/**
|
|
419
|
-
* enable markdown-body class
|
|
420
|
-
* @description 是否启用默认的 markdown 样式
|
|
421
|
-
*/
|
|
422
|
-
markdown?: boolean;
|
|
423
|
-
}
|
|
424
|
-
|
|
425
|
-
interface Header {
|
|
426
|
-
level: number;
|
|
427
|
-
title: string;
|
|
428
|
-
slug: string;
|
|
429
|
-
/**
|
|
430
|
-
* i18n
|
|
431
|
-
*/
|
|
432
|
-
lang?: string;
|
|
433
|
-
}
|
|
434
|
-
interface PageData {
|
|
435
|
-
path: string;
|
|
436
|
-
relativePath: string;
|
|
437
|
-
title: string;
|
|
438
|
-
titleTemplate?: string;
|
|
439
|
-
description: string;
|
|
440
|
-
headers: Header[];
|
|
441
|
-
frontmatter: Post;
|
|
442
|
-
lastUpdated?: number;
|
|
443
|
-
}
|
|
444
|
-
interface PageDataPayload {
|
|
445
|
-
path: string;
|
|
446
|
-
pageData: PageData;
|
|
447
|
-
}
|
|
448
|
-
declare type HeadConfig = [string, Record<string, string>] | [string, Record<string, string>, string];
|
|
449
|
-
|
|
450
|
-
declare module 'vite' {
|
|
451
|
-
interface UserConfig {
|
|
452
|
-
/**
|
|
453
|
-
* Custom internal plugin options for Valaxy (advanced)
|
|
454
|
-
*
|
|
455
|
-
* @see ./options.ts'
|
|
456
|
-
*/
|
|
457
|
-
valaxy?: ValaxyPluginOptions;
|
|
458
|
-
ssgOptions?: ViteSSGOptions;
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
|
|
462
|
-
export { AlgoliaSearchOptions as A, Header as H, Post as P, ResolvedValaxyOptions as R, SocialLink as S, UserConfig as U, ValaxyConfig as V, ValaxyEntryOptions as a, ValaxyThemeConfig as b, ValaxyServerOptions as c, ValaxyPluginOptions as d, resolvePluginOptions as e, PageData as f, getThemeRoot as g, PageDataPayload as h, isPath as i, HeadConfig as j, resolveOptions as r };
|