valaxy 0.21.1 → 0.22.2-beta.5

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