valaxy 0.26.2 → 0.26.4
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/client/composables/collections.ts +1 -1
- package/client/composables/decrypt.ts +6 -3
- package/client/define/collection.ts +1 -35
- package/client/index.d.ts +48 -0
- package/client/shims.d.ts +32 -4
- package/client/tsconfig.json +16 -0
- package/client/types/collection.ts +35 -0
- package/client/types/index.ts +2 -0
- package/dist/node/cli/index.mjs +2 -2
- package/dist/node/index.d.mts +336 -314
- package/dist/node/index.mjs +2 -2
- package/dist/shared/valaxy.BwiZu4ms.d.mts +832 -0
- package/dist/shared/{valaxy.hxuiyMv0.mjs → valaxy.Dv1KXH06.mjs} +305 -305
- package/dist/types/index.d.mts +9 -775
- package/index.d.ts +0 -1
- package/package.json +35 -29
- package/types/frontmatter/page.ts +1 -1
- package/types/index.ts +0 -1
- package/dist/shared/valaxy.D_ue8jlC.d.mts +0 -60
- package/shims.d.ts +0 -85
|
@@ -0,0 +1,832 @@
|
|
|
1
|
+
import { FuseOptions } from '@vueuse/integrations/useFuse';
|
|
2
|
+
import { ZoomOptions } from 'medium-zoom';
|
|
3
|
+
import { ILazyLoadOptions } from 'vanilla-lazyload';
|
|
4
|
+
import { RouteRecordRaw } from 'vue-router';
|
|
5
|
+
import { UseDarkOptions } from '@vueuse/core';
|
|
6
|
+
import { NodeRelations, ImageObject } from '@unhead/schema-org';
|
|
7
|
+
|
|
8
|
+
interface ValaxyAddon<AddonOptions = Record<string, any>> {
|
|
9
|
+
name: string;
|
|
10
|
+
/**
|
|
11
|
+
* be global component
|
|
12
|
+
*/
|
|
13
|
+
global?: boolean;
|
|
14
|
+
props?: Record<string, any>;
|
|
15
|
+
options?: AddonOptions;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
declare namespace DefaultTheme {
|
|
19
|
+
interface Config {
|
|
20
|
+
valaxyDarkOptions?: {
|
|
21
|
+
/**
|
|
22
|
+
* Options for `useDark`
|
|
23
|
+
* disableTransition default is `true`
|
|
24
|
+
* Its options are not computed, init when loaded.
|
|
25
|
+
* @see https://vueuse.org/core/useDark
|
|
26
|
+
* @url https://paco.me/writing/disable-theme-transitions
|
|
27
|
+
*
|
|
28
|
+
* @zh `useDark` 的选项
|
|
29
|
+
* disableTransition 默认为 `true`,不会进行渐变过渡,这是 VueUse 的默认行为
|
|
30
|
+
*/
|
|
31
|
+
useDarkOptions?: UseDarkOptions;
|
|
32
|
+
/**
|
|
33
|
+
* Enable circle transition when toggling dark mode
|
|
34
|
+
* Then use `toggleDarkWithTransition` instead of `toggleDark`
|
|
35
|
+
* @zh 启用圆形过渡切换暗黑模式
|
|
36
|
+
*/
|
|
37
|
+
circleTransition?: boolean;
|
|
38
|
+
/**
|
|
39
|
+
* Theme color
|
|
40
|
+
* @zh 主题色
|
|
41
|
+
*/
|
|
42
|
+
themeColor?: {
|
|
43
|
+
/**
|
|
44
|
+
* Theme color for light mode
|
|
45
|
+
* @zh 亮色主题色
|
|
46
|
+
*/
|
|
47
|
+
light?: string;
|
|
48
|
+
/**
|
|
49
|
+
* Theme color for dark mode
|
|
50
|
+
* @zh 暗色主题色
|
|
51
|
+
*/
|
|
52
|
+
dark?: string;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
/**
|
|
56
|
+
* Custom header levels of outline in the aside component.
|
|
57
|
+
*
|
|
58
|
+
* @default 2
|
|
59
|
+
*/
|
|
60
|
+
outline?: number | [number, number] | 'deep' | false;
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
interface CollectionConfig {
|
|
65
|
+
title?: string;
|
|
66
|
+
key?: string;
|
|
67
|
+
/**
|
|
68
|
+
* if key is not provided, path is required
|
|
69
|
+
*
|
|
70
|
+
* if key is provided, path = `/collections/${key}`
|
|
71
|
+
*/
|
|
72
|
+
path?: string;
|
|
73
|
+
/**
|
|
74
|
+
* @en
|
|
75
|
+
* The name of the collection.
|
|
76
|
+
*
|
|
77
|
+
* @zh
|
|
78
|
+
* 合集名称
|
|
79
|
+
*/
|
|
80
|
+
name?: string;
|
|
81
|
+
cover?: string;
|
|
82
|
+
description?: string;
|
|
83
|
+
categories?: string[];
|
|
84
|
+
tags?: string[];
|
|
85
|
+
/**
|
|
86
|
+
* items
|
|
87
|
+
*/
|
|
88
|
+
items?: {
|
|
89
|
+
title?: string;
|
|
90
|
+
/**
|
|
91
|
+
* 合集文章的唯一索引
|
|
92
|
+
*
|
|
93
|
+
* 对应路径为 `/collections/${key}/${item.key}`
|
|
94
|
+
*/
|
|
95
|
+
key?: string;
|
|
96
|
+
}[];
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
interface Album {
|
|
100
|
+
/**
|
|
101
|
+
* @description:en-US Album Link
|
|
102
|
+
*/
|
|
103
|
+
url: string;
|
|
104
|
+
/**
|
|
105
|
+
* @description:en-US Album cover
|
|
106
|
+
* url
|
|
107
|
+
*/
|
|
108
|
+
cover: string;
|
|
109
|
+
/**
|
|
110
|
+
* @description:en-US Album caption
|
|
111
|
+
*/
|
|
112
|
+
caption: string;
|
|
113
|
+
/**
|
|
114
|
+
* @description:en-US Album description
|
|
115
|
+
*/
|
|
116
|
+
desc: string;
|
|
117
|
+
}
|
|
118
|
+
interface Photo {
|
|
119
|
+
src: string;
|
|
120
|
+
caption: string;
|
|
121
|
+
desc: string;
|
|
122
|
+
}
|
|
123
|
+
interface BaseFrontMatter extends Record<string, any> {
|
|
124
|
+
/**
|
|
125
|
+
* Title
|
|
126
|
+
* @description 文章标题
|
|
127
|
+
*
|
|
128
|
+
* ```md
|
|
129
|
+
* ---
|
|
130
|
+
* title: Post Title
|
|
131
|
+
* ---
|
|
132
|
+
* ```
|
|
133
|
+
*
|
|
134
|
+
* i18n:
|
|
135
|
+
*
|
|
136
|
+
* ```md
|
|
137
|
+
* ---
|
|
138
|
+
* title:
|
|
139
|
+
* en: Post Title
|
|
140
|
+
* zh-CN: 文章标题
|
|
141
|
+
* ---
|
|
142
|
+
* ```
|
|
143
|
+
*/
|
|
144
|
+
title: string | Record<string, string>;
|
|
145
|
+
/**
|
|
146
|
+
* @description:en-US Created Date
|
|
147
|
+
* @description:zh-CN 文章创建日期
|
|
148
|
+
*/
|
|
149
|
+
date: string | number | Date;
|
|
150
|
+
/**
|
|
151
|
+
* Updated Time
|
|
152
|
+
*/
|
|
153
|
+
updated: string | number | Date;
|
|
154
|
+
}
|
|
155
|
+
interface PageFrontMatter extends BaseFrontMatter {
|
|
156
|
+
/**
|
|
157
|
+
* Path of post
|
|
158
|
+
* route.path
|
|
159
|
+
* @description 路径
|
|
160
|
+
*/
|
|
161
|
+
path: string;
|
|
162
|
+
/**
|
|
163
|
+
* abbrlink
|
|
164
|
+
*
|
|
165
|
+
* generated by valaxy-addon-abbrlink, do not manually modify
|
|
166
|
+
*
|
|
167
|
+
* just compatible for [hexo-abbrlink](https://github.com/ohroy/hexo-abbrlink)
|
|
168
|
+
*/
|
|
169
|
+
abbrlink: string;
|
|
170
|
+
/**
|
|
171
|
+
* i18n
|
|
172
|
+
*/
|
|
173
|
+
lang: string;
|
|
174
|
+
/**
|
|
175
|
+
* @description Author
|
|
176
|
+
* @description:zh-CN 作者
|
|
177
|
+
*/
|
|
178
|
+
author: string;
|
|
179
|
+
/**
|
|
180
|
+
* Display sponsor info
|
|
181
|
+
* @description 是否开启赞助
|
|
182
|
+
*/
|
|
183
|
+
sponsor: boolean;
|
|
184
|
+
/**
|
|
185
|
+
* Copyright
|
|
186
|
+
* @description 是否显示文章底部版权信息
|
|
187
|
+
*/
|
|
188
|
+
copyright: boolean;
|
|
189
|
+
/**
|
|
190
|
+
* for seo
|
|
191
|
+
* schema
|
|
192
|
+
*/
|
|
193
|
+
image: NodeRelations<ImageObject | string>;
|
|
194
|
+
/**
|
|
195
|
+
* cover
|
|
196
|
+
* @description 封面图片
|
|
197
|
+
*/
|
|
198
|
+
cover: string;
|
|
199
|
+
/**
|
|
200
|
+
* display toc
|
|
201
|
+
* @description 是否显示目录
|
|
202
|
+
*/
|
|
203
|
+
toc: boolean;
|
|
204
|
+
/**
|
|
205
|
+
* display right sidebar
|
|
206
|
+
* @description 是否显示右侧侧边栏
|
|
207
|
+
*/
|
|
208
|
+
aside: boolean;
|
|
209
|
+
/**
|
|
210
|
+
* display left sidebar
|
|
211
|
+
* @description 是否显示左侧侧边栏
|
|
212
|
+
*/
|
|
213
|
+
sidebar: boolean;
|
|
214
|
+
/**
|
|
215
|
+
* @description:en-US Custom Markdown class
|
|
216
|
+
* @description:zh-CN 自定义 Markdown 样式
|
|
217
|
+
* @default 'markdown-body'
|
|
218
|
+
*/
|
|
219
|
+
markdownClass: string;
|
|
220
|
+
/**
|
|
221
|
+
* @description:en-US Post title class
|
|
222
|
+
* @description:zh-CN 文章标题样式
|
|
223
|
+
*/
|
|
224
|
+
pageTitleClass: string;
|
|
225
|
+
/**
|
|
226
|
+
* icon before title
|
|
227
|
+
* @description 标题前的图标
|
|
228
|
+
*/
|
|
229
|
+
icon: string;
|
|
230
|
+
/**
|
|
231
|
+
* title color
|
|
232
|
+
* @deprecated Please use `pageTitleClass` | `postTitleClass` instead
|
|
233
|
+
*/
|
|
234
|
+
color: string;
|
|
235
|
+
/**
|
|
236
|
+
* display comment
|
|
237
|
+
*/
|
|
238
|
+
comment: boolean;
|
|
239
|
+
/**
|
|
240
|
+
* post is end
|
|
241
|
+
* @description 是否完结,将在末尾添加衬线字体 Q.E.D.
|
|
242
|
+
*/
|
|
243
|
+
end: boolean;
|
|
244
|
+
/**
|
|
245
|
+
* use katex
|
|
246
|
+
* @url https://katex.org/
|
|
247
|
+
*/
|
|
248
|
+
katex: boolean;
|
|
249
|
+
/**
|
|
250
|
+
* use codepen
|
|
251
|
+
* @url https://codepen.io/
|
|
252
|
+
*/
|
|
253
|
+
codepen: boolean;
|
|
254
|
+
/**
|
|
255
|
+
* use medium-zoom
|
|
256
|
+
* @url https://github.com/francoischalifour/medium-zoom
|
|
257
|
+
*/
|
|
258
|
+
medium_zoom: boolean;
|
|
259
|
+
/**
|
|
260
|
+
* @description:en-US Albums
|
|
261
|
+
* @description:zh-CN 相册
|
|
262
|
+
*/
|
|
263
|
+
albums: Album[];
|
|
264
|
+
/**
|
|
265
|
+
* For layout Gallery
|
|
266
|
+
* @description:en-US Photos
|
|
267
|
+
*/
|
|
268
|
+
photos: Photo[];
|
|
269
|
+
/**
|
|
270
|
+
* for collections
|
|
271
|
+
*/
|
|
272
|
+
collections: CollectionConfig[];
|
|
273
|
+
/**
|
|
274
|
+
* @description:zh-CN 是否启用加密,password 存在时默认为 true
|
|
275
|
+
*/
|
|
276
|
+
encrypt: boolean;
|
|
277
|
+
/**
|
|
278
|
+
* @description:zh-CN 加密密码
|
|
279
|
+
*/
|
|
280
|
+
password?: string;
|
|
281
|
+
/**
|
|
282
|
+
* @description:zh-CN 密码提示
|
|
283
|
+
*/
|
|
284
|
+
password_hint?: string;
|
|
285
|
+
/**
|
|
286
|
+
* @description:zh-CN 相册密码
|
|
287
|
+
*/
|
|
288
|
+
gallery_password?: string;
|
|
289
|
+
/**
|
|
290
|
+
* @en
|
|
291
|
+
* @description encrypted content
|
|
292
|
+
*
|
|
293
|
+
* @description:zh-CN 加密后的内容
|
|
294
|
+
*/
|
|
295
|
+
encryptedContent?: string;
|
|
296
|
+
/**
|
|
297
|
+
* @description:zh-CN 部分加密的内容
|
|
298
|
+
*/
|
|
299
|
+
partiallyEncryptedContents?: string[];
|
|
300
|
+
/**
|
|
301
|
+
* @description:zh-CN 加密后的相册
|
|
302
|
+
*/
|
|
303
|
+
encryptedPhotos?: string;
|
|
304
|
+
/**
|
|
305
|
+
* @description:en-US Limit the height of the code block in px
|
|
306
|
+
* @description:zh-CN 限制代码块的高度,单位是 px
|
|
307
|
+
*/
|
|
308
|
+
codeHeightLimit?: number;
|
|
309
|
+
/**
|
|
310
|
+
* @description:en-US Source path for client redirection
|
|
311
|
+
* @description:zh-CN 客户端重定向的源路径
|
|
312
|
+
*/
|
|
313
|
+
from?: string | string[];
|
|
314
|
+
}
|
|
315
|
+
|
|
316
|
+
type ExcerptType = 'md' | 'html' | 'text' | 'ai';
|
|
317
|
+
interface PostFrontMatter extends PageFrontMatter {
|
|
318
|
+
/**
|
|
319
|
+
* @description:en-US Custom post title class in post list
|
|
320
|
+
* @description:zh-CN 文章列表中 自定义标题样式
|
|
321
|
+
*/
|
|
322
|
+
postTitleClass: string;
|
|
323
|
+
/**
|
|
324
|
+
* @description:en-US Post Card Type, can be bilibili/yuque/... (need theme support)
|
|
325
|
+
* @description:zh-CN 卡片类型,可以是 bilibili/yuque/... (需主题支持)
|
|
326
|
+
*/
|
|
327
|
+
type: 'bilibili' | 'yuque' | string;
|
|
328
|
+
/**
|
|
329
|
+
* @en override url, and jump directly
|
|
330
|
+
* @zh 覆盖 post url,直接跳转
|
|
331
|
+
*/
|
|
332
|
+
url: string;
|
|
333
|
+
/**
|
|
334
|
+
* @description:en-US custom excerpt, `excerpt_type` will be invalid
|
|
335
|
+
* @description 手动指定摘要,此时 `excerpt_type` 将会无效
|
|
336
|
+
*/
|
|
337
|
+
excerpt: string;
|
|
338
|
+
/**
|
|
339
|
+
* @description 摘要类型
|
|
340
|
+
* @default 'html'
|
|
341
|
+
* render type of excerpt
|
|
342
|
+
* - md: render as raw markdown
|
|
343
|
+
* - html: render as html
|
|
344
|
+
* - text: render as text
|
|
345
|
+
*/
|
|
346
|
+
excerpt_type: 'md' | 'text' | 'html' | 'ai';
|
|
347
|
+
/**
|
|
348
|
+
* @description:en-US Category, if it is an array, it represents multiple folders in order
|
|
349
|
+
* @description:zh-CN 分类,若为数组,则按顺序代表多层文件夹
|
|
350
|
+
*/
|
|
351
|
+
categories: string | string[];
|
|
352
|
+
/**
|
|
353
|
+
* @description:en-US Tags, can have multiple
|
|
354
|
+
* @description:zh-CN 标签,可以有多个
|
|
355
|
+
*/
|
|
356
|
+
tags: string[];
|
|
357
|
+
/**
|
|
358
|
+
* @description:en-US Whether to display the previous and next navigation
|
|
359
|
+
* @description:zh-CN 是否显示前一篇、后一篇导航
|
|
360
|
+
*/
|
|
361
|
+
nav: boolean;
|
|
362
|
+
/**
|
|
363
|
+
* @description:en-US Pin to top, the larger the number, the closer to the front
|
|
364
|
+
* @description:zh-CN 置顶,数字越大越靠前
|
|
365
|
+
*/
|
|
366
|
+
top: number;
|
|
367
|
+
/**
|
|
368
|
+
* @description:en-US Whether it is a draft, it will only be displayed during development
|
|
369
|
+
* @description:zh-CN 是否为草稿,将仅在开发时被展示
|
|
370
|
+
*/
|
|
371
|
+
draft: boolean;
|
|
372
|
+
/**
|
|
373
|
+
* hide in index
|
|
374
|
+
* - true/`all`: hide in index & archive
|
|
375
|
+
* - `index`: hide in index
|
|
376
|
+
* @description 是否隐藏
|
|
377
|
+
*/
|
|
378
|
+
hide: 'index' | boolean;
|
|
379
|
+
/**
|
|
380
|
+
* @en
|
|
381
|
+
* when the post is updated more than 30 days ago, show a warning
|
|
382
|
+
* default 30 days, you can set `time_warning` in frontmatter to change it
|
|
383
|
+
*
|
|
384
|
+
* @zh
|
|
385
|
+
* 当文章更新时间超过 30 天时,显示一个警告
|
|
386
|
+
* 默认 30 天,你可以在 frontmatter 中设置 `time_warning` (数字)来修改,单位 ms
|
|
387
|
+
* @example 3600000
|
|
388
|
+
*/
|
|
389
|
+
time_warning: boolean | number;
|
|
390
|
+
/**
|
|
391
|
+
* @protected
|
|
392
|
+
* @see https://valaxy.site/guide/config/#%E9%98%85%E8%AF%BB%E7%BB%9F%E8%AE%A1
|
|
393
|
+
* @tutorial ⚠️ DO NOT SET MANUALLY (generated by `site.config.ts` -> `statistics.enable: true`)
|
|
394
|
+
* You can use `statistics.readTime.speed` to change the speed of reading time.
|
|
395
|
+
* @description:en-US Reading time
|
|
396
|
+
* @description:zh-CN 阅读时间
|
|
397
|
+
*/
|
|
398
|
+
readingTime: number;
|
|
399
|
+
/**
|
|
400
|
+
* @protected
|
|
401
|
+
* @see https://valaxy.site/guide/config/#%E9%98%85%E8%AF%BB%E7%BB%9F%E8%AE%A1
|
|
402
|
+
* @tutorial ⚠️ DO NOT SET MANUALLY (generated by `site.config.ts` -> `statistics.enable: true`)
|
|
403
|
+
* You need enable `statistics` in site config to use this feature.
|
|
404
|
+
* @description:en-US Word count
|
|
405
|
+
* @description:zh-CN 字数统计
|
|
406
|
+
*/
|
|
407
|
+
wordCount: string;
|
|
408
|
+
}
|
|
409
|
+
|
|
410
|
+
interface FuseListItem extends Record<string, any> {
|
|
411
|
+
title: string | Record<string, string>;
|
|
412
|
+
excerpt?: string;
|
|
413
|
+
author: string;
|
|
414
|
+
tags: string[];
|
|
415
|
+
categories: string[];
|
|
416
|
+
link: string;
|
|
417
|
+
content?: string;
|
|
418
|
+
}
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* @zh 社交链接
|
|
422
|
+
*/
|
|
423
|
+
interface SocialLink {
|
|
424
|
+
/**
|
|
425
|
+
* The title of your link
|
|
426
|
+
*/
|
|
427
|
+
name: string;
|
|
428
|
+
link: string;
|
|
429
|
+
/**
|
|
430
|
+
* 图标名称
|
|
431
|
+
* https://icones.js.org/
|
|
432
|
+
*/
|
|
433
|
+
icon: string;
|
|
434
|
+
/**
|
|
435
|
+
* @zh 图标颜色
|
|
436
|
+
*/
|
|
437
|
+
color: string;
|
|
438
|
+
}
|
|
439
|
+
interface RedirectRule {
|
|
440
|
+
to: string;
|
|
441
|
+
from: string | string[];
|
|
442
|
+
}
|
|
443
|
+
interface RedirectItem {
|
|
444
|
+
from: string;
|
|
445
|
+
to: string;
|
|
446
|
+
}
|
|
447
|
+
interface SiteConfig {
|
|
448
|
+
/**
|
|
449
|
+
* enable auto (light/dark mode)
|
|
450
|
+
* @default 'auto'
|
|
451
|
+
*/
|
|
452
|
+
mode: 'light' | 'dark' | 'auto';
|
|
453
|
+
/**
|
|
454
|
+
* Default language
|
|
455
|
+
* @description 默认语言,设置 `zh-CN` 以改变默认语言为中文
|
|
456
|
+
* @default 'en'
|
|
457
|
+
*/
|
|
458
|
+
lang: string;
|
|
459
|
+
/**
|
|
460
|
+
* alternative languages
|
|
461
|
+
* @description 可选语言
|
|
462
|
+
* @en If you want to disable multi-language support for your site, you can set this to only include one language (e.g. `['en']`)
|
|
463
|
+
* @zh 如果你想要禁言站点的多语言支持,可以将此项设置为仅包含一个语言 (例如 `['zh-CN']`)
|
|
464
|
+
* @default ['en', 'zh-CN']
|
|
465
|
+
* @see https://ogp.me/#optional
|
|
466
|
+
*/
|
|
467
|
+
languages: string[];
|
|
468
|
+
/**
|
|
469
|
+
* You site url in web, required for ssg & rss
|
|
470
|
+
* @description 站点的完整 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
471
|
+
* @example 'https://valaxy.site'
|
|
472
|
+
* @default '/'
|
|
473
|
+
*/
|
|
474
|
+
/**
|
|
475
|
+
* @see https://wikipedia.org/wiki/List_of_tz_database_time_zones
|
|
476
|
+
* @en_US Timezone configuration
|
|
477
|
+
* @zh_CN 时区配置,国内推荐使用 'Asia/Shanghai'
|
|
478
|
+
* @description:en-US This configuration is used to generate times with timezone when no timezone is set
|
|
479
|
+
* @description:zh-CN 当时间没有设置时区时,使用该配置生成带时区的时间
|
|
480
|
+
* @default ''
|
|
481
|
+
*/
|
|
482
|
+
timezone: string;
|
|
483
|
+
url: string;
|
|
484
|
+
/**
|
|
485
|
+
* Site title
|
|
486
|
+
* @description 站点标题
|
|
487
|
+
*/
|
|
488
|
+
title: string;
|
|
489
|
+
/**
|
|
490
|
+
* 副标题
|
|
491
|
+
*/
|
|
492
|
+
subtitle: string;
|
|
493
|
+
/**
|
|
494
|
+
* 站点描述
|
|
495
|
+
*/
|
|
496
|
+
description: string;
|
|
497
|
+
/**
|
|
498
|
+
* The owner of this blog
|
|
499
|
+
* @description 博客作者
|
|
500
|
+
*/
|
|
501
|
+
author: {
|
|
502
|
+
/**
|
|
503
|
+
* Your name
|
|
504
|
+
* @description 你的名字
|
|
505
|
+
*/
|
|
506
|
+
name: string;
|
|
507
|
+
email: string;
|
|
508
|
+
link: string;
|
|
509
|
+
avatar: string;
|
|
510
|
+
/**
|
|
511
|
+
* The status of you
|
|
512
|
+
* @description 状态
|
|
513
|
+
*/
|
|
514
|
+
status: {
|
|
515
|
+
/**
|
|
516
|
+
* Emoji representation of your status like '👨💻'
|
|
517
|
+
* @description 你的状态的 Emoji 表示,如 '👨💻'
|
|
518
|
+
*/
|
|
519
|
+
emoji: string;
|
|
520
|
+
/**
|
|
521
|
+
* show when hover emoji
|
|
522
|
+
* @description 当鼠标悬浮在图标上时显示
|
|
523
|
+
*/
|
|
524
|
+
message: string;
|
|
525
|
+
};
|
|
526
|
+
/**
|
|
527
|
+
* @zh 个人简介
|
|
528
|
+
*/
|
|
529
|
+
intro?: string;
|
|
530
|
+
};
|
|
531
|
+
/**
|
|
532
|
+
* show last updated time by git/mtime
|
|
533
|
+
*/
|
|
534
|
+
lastUpdated: boolean;
|
|
535
|
+
/**
|
|
536
|
+
* icon for your website
|
|
537
|
+
*/
|
|
538
|
+
favicon: string;
|
|
539
|
+
feed: {
|
|
540
|
+
/**
|
|
541
|
+
* name: feed -> feed.xml / feed.atom / feed.json
|
|
542
|
+
* @default '' -> feed.xml / atom.xml / feed.json
|
|
543
|
+
*/
|
|
544
|
+
name: string;
|
|
545
|
+
favicon: string;
|
|
546
|
+
};
|
|
547
|
+
/**
|
|
548
|
+
* 社交链接
|
|
549
|
+
*/
|
|
550
|
+
social: SocialLink[];
|
|
551
|
+
/**
|
|
552
|
+
* @en search engine for your site
|
|
553
|
+
* @zh 搜索功能
|
|
554
|
+
*/
|
|
555
|
+
search: {
|
|
556
|
+
/**
|
|
557
|
+
* @zh 是否启用
|
|
558
|
+
*/
|
|
559
|
+
enable: boolean;
|
|
560
|
+
/**
|
|
561
|
+
* Search Type
|
|
562
|
+
* - algolia: Algolia Search
|
|
563
|
+
* - engine: Engine Search, like Google/Baidu
|
|
564
|
+
* - fuse: Local Search by fuse.js
|
|
565
|
+
*/
|
|
566
|
+
type: 'algolia' | 'engine' | 'fuse';
|
|
567
|
+
};
|
|
568
|
+
/**
|
|
569
|
+
*
|
|
570
|
+
* fuse search
|
|
571
|
+
* @see https://fusejs.io/
|
|
572
|
+
* @description 本地搜索
|
|
573
|
+
* Please set search.type to 'fuse'
|
|
574
|
+
*/
|
|
575
|
+
fuse: {
|
|
576
|
+
/**
|
|
577
|
+
* @default 'valaxy-fuse-list.json'
|
|
578
|
+
* @description 搜索结果列表数据所在路径
|
|
579
|
+
*/
|
|
580
|
+
dataPath: string;
|
|
581
|
+
/**
|
|
582
|
+
* fast-glob pattern to match Fuse List Data
|
|
583
|
+
* @default `pages\/**\/*.md`
|
|
584
|
+
* ```ts
|
|
585
|
+
* await fg(`${userRoot}/pages/posts/**\/*.md`)
|
|
586
|
+
* ```
|
|
587
|
+
*/
|
|
588
|
+
pattern?: string;
|
|
589
|
+
/**
|
|
590
|
+
* @see https://fusejs.io/api/options.html
|
|
591
|
+
*/
|
|
592
|
+
options: FuseOptions<FuseListItem> & {
|
|
593
|
+
/**
|
|
594
|
+
* @en_US The fields to be searched.
|
|
595
|
+
* @zh_CN 搜索的字段
|
|
596
|
+
* @default ['title', 'tags', 'categories', 'excerpt']
|
|
597
|
+
* @description:en-US List of keys that will be searched. This supports nested paths, weighted search, and searching in arrays of strings and objects
|
|
598
|
+
* @description:zh-CN 搜索将会涉及的字段列表,支持嵌套路径、加权搜索以及在字符串和对象数组中进行搜索
|
|
599
|
+
* @see https://fusejs.io/api/options.html#keys
|
|
600
|
+
*/
|
|
601
|
+
keys: FuseOptions<FuseListItem>['keys'];
|
|
602
|
+
};
|
|
603
|
+
};
|
|
604
|
+
/**
|
|
605
|
+
* set post default frontmatter
|
|
606
|
+
*/
|
|
607
|
+
frontmatter: Partial<PostFrontMatter>;
|
|
608
|
+
/**
|
|
609
|
+
* comment: waline/...
|
|
610
|
+
*/
|
|
611
|
+
comment: {
|
|
612
|
+
enable: boolean;
|
|
613
|
+
};
|
|
614
|
+
/**
|
|
615
|
+
* third-party plugin need cdn
|
|
616
|
+
* aplayer, twikoo
|
|
617
|
+
* @default 'https://unpkg.com/'
|
|
618
|
+
*/
|
|
619
|
+
cdn: {
|
|
620
|
+
/**
|
|
621
|
+
* prefix for your third-party
|
|
622
|
+
* @default 'https://unpkg.com/'
|
|
623
|
+
*/
|
|
624
|
+
prefix: string;
|
|
625
|
+
};
|
|
626
|
+
/**
|
|
627
|
+
* The license of your posts
|
|
628
|
+
* @description 文章所使用的协议,默认使用 Creative Commons
|
|
629
|
+
* @default https://creativecommons.org/licenses/
|
|
630
|
+
*/
|
|
631
|
+
license: {
|
|
632
|
+
/**
|
|
633
|
+
* Whether to show at the bottom of the article
|
|
634
|
+
* @description 是否显示在文章底部
|
|
635
|
+
* @default true
|
|
636
|
+
*/
|
|
637
|
+
enabled: boolean;
|
|
638
|
+
/**
|
|
639
|
+
* Creative License Language, same with your config.lang
|
|
640
|
+
* when lang === 'zh-CN', use 'zh'
|
|
641
|
+
* @description 默认与站点语言相同
|
|
642
|
+
* @default 'en'
|
|
643
|
+
*/
|
|
644
|
+
language: string;
|
|
645
|
+
/**
|
|
646
|
+
* Type of license
|
|
647
|
+
* @description 证书类型
|
|
648
|
+
* @default 'by-nc-sa'
|
|
649
|
+
*/
|
|
650
|
+
type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd';
|
|
651
|
+
};
|
|
652
|
+
/**
|
|
653
|
+
* donate for author
|
|
654
|
+
* @description 打赏/赞助
|
|
655
|
+
*/
|
|
656
|
+
sponsor: {
|
|
657
|
+
enable: boolean;
|
|
658
|
+
/**
|
|
659
|
+
* Donate button title attribute
|
|
660
|
+
* @description 打赏按钮的 title 属性
|
|
661
|
+
* @default zh:'打赏' en:'Donate'
|
|
662
|
+
*/
|
|
663
|
+
title?: string;
|
|
664
|
+
/**
|
|
665
|
+
* Donate content description
|
|
666
|
+
* @description 打赏的描述内容,在按钮下方所有图片上方,与图片一起折叠
|
|
667
|
+
* @default undefined 不显示内容
|
|
668
|
+
*/
|
|
669
|
+
description?: string;
|
|
670
|
+
/**
|
|
671
|
+
* @zh 赞助方式
|
|
672
|
+
*/
|
|
673
|
+
methods: {
|
|
674
|
+
name: string;
|
|
675
|
+
url: string;
|
|
676
|
+
color: string;
|
|
677
|
+
icon: string;
|
|
678
|
+
}[];
|
|
679
|
+
};
|
|
680
|
+
/**
|
|
681
|
+
* image preview by medium-zoom
|
|
682
|
+
* @url https://github.com/francoischalifour/medium-zoom
|
|
683
|
+
*/
|
|
684
|
+
mediumZoom: {
|
|
685
|
+
/**
|
|
686
|
+
* @zh 启用图片预览
|
|
687
|
+
*/
|
|
688
|
+
enable: boolean;
|
|
689
|
+
/**
|
|
690
|
+
* For example: '.markdown-body img'
|
|
691
|
+
* @default '' content.value querySelectorAll('img')
|
|
692
|
+
*/
|
|
693
|
+
selector: string | HTMLElement | HTMLElement[];
|
|
694
|
+
/**
|
|
695
|
+
* @zh 配置项
|
|
696
|
+
* @see https://github.com/francoischalifour/medium-zoom#options
|
|
697
|
+
*/
|
|
698
|
+
options: ZoomOptions;
|
|
699
|
+
};
|
|
700
|
+
/**
|
|
701
|
+
* lazyload by vanilla-lazyload and markdown-it-image-figures
|
|
702
|
+
* when vanillaLazyLoad.enable is true, imageFigures removeSrc is true, classes is 'lazy'
|
|
703
|
+
* @see https://github.com/verlok/vanilla-lazyload
|
|
704
|
+
*/
|
|
705
|
+
vanillaLazyload: {
|
|
706
|
+
enable: boolean;
|
|
707
|
+
options: ILazyLoadOptions;
|
|
708
|
+
};
|
|
709
|
+
/**
|
|
710
|
+
* Floating Vue configuration for floating footnote tooltips.
|
|
711
|
+
* @see https://floating-vue.starpad.dev/guide/config
|
|
712
|
+
*/
|
|
713
|
+
floatingVue: any;
|
|
714
|
+
/**
|
|
715
|
+
* displayed posts length in every page
|
|
716
|
+
* @default 7
|
|
717
|
+
*/
|
|
718
|
+
pageSize: number;
|
|
719
|
+
/**
|
|
720
|
+
* statistics readingTime and wordCount
|
|
721
|
+
* @description 统计阅读时间和字数
|
|
722
|
+
*/
|
|
723
|
+
statistics: {
|
|
724
|
+
enable: boolean;
|
|
725
|
+
readTime: {
|
|
726
|
+
speed: {
|
|
727
|
+
/**
|
|
728
|
+
* Chinese word count speed
|
|
729
|
+
* @description 中文每分钟阅读字数
|
|
730
|
+
* @default 300 (300 字/分钟)
|
|
731
|
+
*/
|
|
732
|
+
cn: number;
|
|
733
|
+
/**
|
|
734
|
+
* English word count speed
|
|
735
|
+
* @description 英文每分钟阅读字数
|
|
736
|
+
* @default 100 (200 字/分钟)
|
|
737
|
+
*/
|
|
738
|
+
en: number;
|
|
739
|
+
};
|
|
740
|
+
};
|
|
741
|
+
};
|
|
742
|
+
/**
|
|
743
|
+
* @description Encrypt article
|
|
744
|
+
* @description:zh-CN 加密文章
|
|
745
|
+
* default algorithm: AES-CBC
|
|
746
|
+
*/
|
|
747
|
+
encrypt: {
|
|
748
|
+
enable: boolean;
|
|
749
|
+
/**
|
|
750
|
+
* [encrypt](https://developer.mozilla.org/zh-CN/docs/Web/API/SubtleCrypto/encrypt#%E6%94%AF%E6%8C%81%E7%9A%84%E7%AE%97%E6%B3%95)
|
|
751
|
+
* @default AES-CBC
|
|
752
|
+
*/
|
|
753
|
+
algorithm: string;
|
|
754
|
+
iv: Uint8Array;
|
|
755
|
+
salt: Uint8Array;
|
|
756
|
+
};
|
|
757
|
+
/**
|
|
758
|
+
* @description:en-US Limit the height of the code block in px
|
|
759
|
+
* @description:zh-CN 限制代码块的高度,单位是 px
|
|
760
|
+
*/
|
|
761
|
+
codeHeightLimit?: number;
|
|
762
|
+
/**
|
|
763
|
+
* @description:en-US client redirect rules
|
|
764
|
+
* @description:zh-CN 客户端重定向规则
|
|
765
|
+
*/
|
|
766
|
+
redirects?: {
|
|
767
|
+
useVueRouter?: boolean;
|
|
768
|
+
rules?: RedirectRule[];
|
|
769
|
+
};
|
|
770
|
+
}
|
|
771
|
+
type PartialDeep<T> = {
|
|
772
|
+
[P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P];
|
|
773
|
+
};
|
|
774
|
+
/**
|
|
775
|
+
* config generated by runtime
|
|
776
|
+
*/
|
|
777
|
+
interface RuntimeConfig {
|
|
778
|
+
addons: Record<string, ValaxyAddon>;
|
|
779
|
+
redirects: {
|
|
780
|
+
useVueRouter: boolean;
|
|
781
|
+
redirectRoutes: RouteRecordRaw[];
|
|
782
|
+
};
|
|
783
|
+
}
|
|
784
|
+
interface Pkg {
|
|
785
|
+
name: string;
|
|
786
|
+
version: string;
|
|
787
|
+
homepage?: string;
|
|
788
|
+
[key: string]: any;
|
|
789
|
+
}
|
|
790
|
+
interface ValaxyConfig<ThemeConfig = DefaultTheme.Config> {
|
|
791
|
+
/**
|
|
792
|
+
* @en Site **info** config. This affects info displayed on the site, and is independent of themes.
|
|
793
|
+
* @zh 站点**信息**配置,这部分内容面向站点展示,且在不同主题中也是通用的格式
|
|
794
|
+
* @see [站点配置 | Valaxy](https://valaxy.site/guide/config#%E7%AB%99%E7%82%B9%E9%85%8D%E7%BD%AE)
|
|
795
|
+
* @see [Site Config | Valaxy](https://valaxy.site/guide/config#site-config)
|
|
796
|
+
*/
|
|
797
|
+
siteConfig: SiteConfig;
|
|
798
|
+
/**
|
|
799
|
+
* The name of theme
|
|
800
|
+
* @description 主题名称
|
|
801
|
+
* @see 主题橱窗 [Valaxy Themes Gallery](https://valaxy.site/themes/gallery)
|
|
802
|
+
* @see 如何编写主题? [How to write a theme? | Valaxy](https://valaxy.site/themes/write)
|
|
803
|
+
* @see [默认 Yun 主题示例](https://yun.valaxy.site/)
|
|
804
|
+
*/
|
|
805
|
+
theme: string;
|
|
806
|
+
/**
|
|
807
|
+
* The config of theme
|
|
808
|
+
* @zh 请参考对应主题的相关文档
|
|
809
|
+
* @description 主题配置
|
|
810
|
+
* @see [默认 Yun 主题文档](https://github.com/YunYouJun/valaxy/blob/main/packages/valaxy-theme-yun/docs/README.md)
|
|
811
|
+
*/
|
|
812
|
+
themeConfig: ThemeConfig & {
|
|
813
|
+
pkg: Pkg;
|
|
814
|
+
};
|
|
815
|
+
/**
|
|
816
|
+
* @en Generated in runtime, do not modify manually
|
|
817
|
+
* @zh 在运行时生成,请勿手动修改
|
|
818
|
+
*/
|
|
819
|
+
runtimeConfig: RuntimeConfig;
|
|
820
|
+
}
|
|
821
|
+
/**
|
|
822
|
+
* user site config
|
|
823
|
+
*/
|
|
824
|
+
type UserSiteConfig = PartialDeep<SiteConfig>;
|
|
825
|
+
/**
|
|
826
|
+
* Valaxy User Config
|
|
827
|
+
* @description Valaxy 用户配置
|
|
828
|
+
*/
|
|
829
|
+
type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
|
|
830
|
+
|
|
831
|
+
export { DefaultTheme as D };
|
|
832
|
+
export type { Album as A, BaseFrontMatter as B, ExcerptType as E, FuseListItem as F, PartialDeep as P, RuntimeConfig as R, SiteConfig as S, UserSiteConfig as U, ValaxyConfig as V, RedirectItem as a, ValaxyAddon as b, PostFrontMatter as c, PageFrontMatter as d, SocialLink as e, RedirectRule as f, Pkg as g, UserValaxyConfig as h, Photo as i };
|