valaxy 1.3.3 → 1.4.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.
@@ -1,403 +1,11 @@
1
1
  import { Header } from '@valaxyjs/utils';
2
+ import { PostFrontMatter, PageFrontMatter, ExcerptType } from 'valaxy/types/frontmatter';
3
+ import { C as CollectionConfig } from './valaxy.CaLqd5CH.mjs';
2
4
  import { FuseOptions } from '@vueuse/integrations/useFuse';
3
5
  import { ZoomOptions } from 'medium-zoom';
4
6
  import { ILazyLoadOptions } from 'vanilla-lazyload';
5
7
  import { RouteRecordRaw } from 'vue-router';
6
8
  import { UseDarkOptions } from '@vueuse/core';
7
- import { NodeRelations, ImageObject } from '@unhead/schema-org';
8
-
9
- interface CollectionConfig {
10
- title?: string;
11
- key?: string;
12
- /**
13
- * if key is not provided, path is required
14
- *
15
- * if key is provided, path = `/collections/${key}`
16
- */
17
- path?: string;
18
- /**
19
- * @en
20
- * The name of the collection.
21
- *
22
- * @zh
23
- * 合集名称
24
- */
25
- name?: string;
26
- cover?: string;
27
- description?: string;
28
- categories?: string[];
29
- tags?: string[];
30
- /**
31
- * @en Whether to show collection as a single collapsed entry in homepage/archive lists.
32
- * When true (default), a synthetic collection card is added to the post list,
33
- * representing all articles in the collection as one entry.
34
- * When false, no synthetic entry is added.
35
- * @zh 是否在首页/归档列表中以单个条目展示合集。
36
- * 为 true(默认)时,合集以一张卡片出现在文章列表中,
37
- * 代表合集内的所有文章。
38
- * 为 false 时,不添加合集条目。
39
- * @default true
40
- */
41
- collapse?: boolean;
42
- /**
43
- * items
44
- */
45
- items?: {
46
- title?: string;
47
- /**
48
- * 合集文章的唯一索引
49
- *
50
- * 对应路径为 `/collections/${key}/${item.key}`
51
- */
52
- key?: string;
53
- /**
54
- * @en
55
- * Link to an existing page or external URL.
56
- * Internal links (starting with `/`) use `<RouterLink>`.
57
- * External links (e.g. `https://...`) open in a new tab.
58
- * Mutually exclusive with `key` — if both are set, `link` takes precedence.
59
- *
60
- * @zh
61
- * 链接到已有页面或外部 URL。
62
- * 内部链接(以 `/` 开头)使用 `<RouterLink>`。
63
- * 外部链接(如 `https://...`)在新标签页中打开。
64
- * 与 `key` 互斥——若同时设置,`link` 优先。
65
- */
66
- link?: string;
67
- }[];
68
- }
69
-
70
- interface Album {
71
- /**
72
- * @description:en-US Album Link
73
- */
74
- url: string;
75
- /**
76
- * @description:en-US Album cover
77
- * url
78
- */
79
- cover: string;
80
- /**
81
- * @description:en-US Album caption
82
- */
83
- caption: string;
84
- /**
85
- * @description:en-US Album description
86
- */
87
- desc: string;
88
- }
89
- interface Photo {
90
- src: string;
91
- caption: string;
92
- desc: string;
93
- }
94
- interface BaseFrontMatter extends Record<string, any> {
95
- /** Canonical URL or site-relative path, independent of the current route alias. */
96
- canonical?: string;
97
- /**
98
- * Title
99
- * @description 文章标题
100
- *
101
- * ```md
102
- * ---
103
- * title: Post Title
104
- * ---
105
- * ```
106
- *
107
- * i18n:
108
- *
109
- * ```md
110
- * ---
111
- * title:
112
- * en: Post Title
113
- * zh-CN: 文章标题
114
- * ---
115
- * ```
116
- */
117
- title: string | Record<string, string>;
118
- /**
119
- * @description:en-US Created Date
120
- * @description:zh-CN 文章创建日期
121
- */
122
- date: string | number | Date;
123
- /**
124
- * Updated Time
125
- */
126
- updated: string | number | Date;
127
- }
128
- interface PageFrontMatter extends BaseFrontMatter {
129
- /**
130
- * Path of post
131
- * route.path
132
- * @description 路径
133
- */
134
- path: string;
135
- /**
136
- * abbrlink
137
- *
138
- * generated by valaxy-addon-abbrlink, do not manually modify
139
- *
140
- * just compatible for [hexo-abbrlink](https://github.com/ohroy/hexo-abbrlink)
141
- */
142
- abbrlink: string;
143
- /**
144
- * i18n
145
- */
146
- lang: string;
147
- /**
148
- * @description Author
149
- * @description:zh-CN 作者
150
- */
151
- author: string;
152
- /**
153
- * Display sponsor info
154
- * @description 是否开启赞助
155
- */
156
- sponsor: boolean;
157
- /**
158
- * Copyright
159
- * @description 是否显示文章底部版权信息
160
- */
161
- copyright: boolean;
162
- /**
163
- * for seo
164
- * schema
165
- */
166
- image: NodeRelations<ImageObject | string>;
167
- /**
168
- * cover
169
- * @description 封面图片(使用组件封面时可省略)
170
- */
171
- cover?: string;
172
- /**
173
- * @description:en-US Vue component name from components/covers/, rendered by supporting themes. An image cover is optional.
174
- * @description:zh-CN components/covers/ 下的 Vue 组件名,由支持的主题渲染。图片 cover 可省略。
175
- */
176
- coverComponent?: string;
177
- /** JSON-serializable props passed to the cover component. */
178
- coverProps?: Record<string, unknown>;
179
- /**
180
- * @description:en-US Open Graph image for SEO
181
- * @description:zh-CN Open Graph 图片,用于 SEO
182
- */
183
- ogImage: string;
184
- /**
185
- * @protected
186
- * @tutorial ⚠️ DO NOT SET MANUALLY (auto-extracted from markdown content)
187
- * @description:en-US First image URL extracted from markdown content
188
- * @description:zh-CN 从 Markdown 内容中自动提取的第一张图片 URL
189
- */
190
- firstImage: string;
191
- /**
192
- * display toc
193
- * @description 是否显示目录
194
- */
195
- toc: boolean;
196
- /**
197
- * display right sidebar
198
- * @description 是否显示右侧侧边栏
199
- */
200
- aside: boolean;
201
- /**
202
- * display left sidebar
203
- * @description 是否显示左侧侧边栏
204
- */
205
- sidebar: boolean;
206
- /**
207
- * @description:en-US Custom Markdown class
208
- * @description:zh-CN 自定义 Markdown 样式
209
- * @default 'markdown-body'
210
- */
211
- markdownClass: string;
212
- /**
213
- * @description:en-US Post title class
214
- * @description:zh-CN 文章标题样式
215
- */
216
- pageTitleClass: string;
217
- /**
218
- * icon before title
219
- * @description 标题前的图标
220
- */
221
- icon: string;
222
- /**
223
- * display comment
224
- */
225
- comment: boolean;
226
- /**
227
- * post is end
228
- * @description 是否完结,将在末尾添加衬线字体 Q.E.D.
229
- */
230
- end: boolean;
231
- /**
232
- * Enable/disable KaTeX math rendering for this page.
233
- * Overrides the global `features.katex` setting.
234
- *
235
- * - When `features.katex: true` (default), set `katex: false` to disable KaTeX for this page.
236
- * - When `features.katex: false`, set `katex: true` to enable KaTeX for this page.
237
- *
238
- * @url https://katex.org/
239
- */
240
- katex: boolean;
241
- /**
242
- * use codepen
243
- * @url https://codepen.io/
244
- */
245
- codepen: boolean;
246
- /**
247
- * use medium-zoom
248
- * @url https://github.com/francoischalifour/medium-zoom
249
- */
250
- medium_zoom: boolean;
251
- /**
252
- * @description:en-US Albums
253
- * @description:zh-CN 相册
254
- */
255
- albums: Album[];
256
- /**
257
- * For layout Gallery
258
- * @description:en-US Photos
259
- */
260
- photos: Photo[];
261
- /**
262
- * for collections
263
- */
264
- collections: CollectionConfig[];
265
- /**
266
- * @description:zh-CN 是否启用加密,password 存在时默认为 true
267
- */
268
- encrypt: boolean;
269
- /**
270
- * @description:zh-CN 加密密码
271
- */
272
- password?: string;
273
- /**
274
- * @description:zh-CN 密码提示
275
- */
276
- password_hint?: string;
277
- /**
278
- * @description:zh-CN 相册密码
279
- */
280
- gallery_password?: string;
281
- /**
282
- * @en
283
- * @description encrypted content
284
- *
285
- * @description:zh-CN 加密后的内容
286
- */
287
- encryptedContent?: string;
288
- /**
289
- * @description:zh-CN 部分加密的内容
290
- */
291
- partiallyEncryptedContents?: string[];
292
- /**
293
- * @description:zh-CN 加密后的相册
294
- */
295
- encryptedPhotos?: string;
296
- /**
297
- * @description:en-US Limit the height of the code block in px
298
- * @description:zh-CN 限制代码块的高度,单位是 px
299
- */
300
- codeHeightLimit?: number;
301
- /**
302
- * @description:en-US Source path for client redirection
303
- * @description:zh-CN 客户端重定向的源路径
304
- */
305
- from?: string | string[];
306
- }
307
-
308
- type ExcerptType = 'md' | 'html' | 'text' | 'ai';
309
- interface PostFrontMatter extends PageFrontMatter {
310
- /**
311
- * @description:en-US Custom post title class in post list
312
- * @description:zh-CN 文章列表中 自定义标题样式
313
- */
314
- postTitleClass: string;
315
- /**
316
- * @description:en-US Post Card Type, can be bilibili/yuque/... (need theme support)
317
- * @description:zh-CN 卡片类型,可以是 bilibili/yuque/... (需主题支持)
318
- */
319
- type: 'bilibili' | 'yuque' | string;
320
- /**
321
- * @en override url, and jump directly
322
- * @zh 覆盖 post url,直接跳转
323
- */
324
- url: string;
325
- /**
326
- * @description:en-US custom excerpt, `excerpt_type` will be invalid
327
- * @description 手动指定摘要,此时 `excerpt_type` 将会无效
328
- */
329
- excerpt: string;
330
- /**
331
- * @description 摘要类型
332
- * @default 'html'
333
- * render type of excerpt
334
- * - md: render as raw markdown
335
- * - html: render as html
336
- * - text: render as text
337
- */
338
- excerpt_type: 'md' | 'text' | 'html' | 'ai';
339
- /**
340
- * @description:en-US Category, if it is an array, it represents multiple folders in order
341
- * @description:zh-CN 分类,若为数组,则按顺序代表多层文件夹
342
- */
343
- categories: string | string[];
344
- /**
345
- * @description:en-US Tags, can have multiple
346
- * @description:zh-CN 标签,可以有多个
347
- */
348
- tags: string[];
349
- /**
350
- * @description:en-US Whether to display the previous and next navigation
351
- * @description:zh-CN 是否显示前一篇、后一篇导航
352
- */
353
- nav: boolean;
354
- /**
355
- * @description:en-US Pin to top, the larger the number, the closer to the front
356
- * @description:zh-CN 置顶,数字越大越靠前
357
- */
358
- top: number;
359
- /**
360
- * @description:en-US Whether it is a draft, it will only be displayed during development
361
- * @description:zh-CN 是否为草稿,将仅在开发时被展示
362
- */
363
- draft: boolean;
364
- /**
365
- * hide in index
366
- * - true/`all`: hide in index & archive
367
- * - `index`: hide in index
368
- * @description 是否隐藏
369
- */
370
- hide: 'index' | boolean;
371
- /**
372
- * @en
373
- * when the post is updated more than 30 days ago, show a warning
374
- * default 30 days, you can set `time_warning` in frontmatter to change it
375
- *
376
- * @zh
377
- * 当文章更新时间超过 30 天时,显示一个警告
378
- * 默认 30 天,你可以在 frontmatter 中设置 `time_warning` (数字)来修改,单位 ms
379
- * @example 3600000
380
- */
381
- time_warning: boolean | number;
382
- /**
383
- * @protected
384
- * @see https://valaxy.site/guide/config/#%E9%98%85%E8%AF%BB%E7%BB%9F%E8%AE%A1
385
- * @tutorial ⚠️ DO NOT SET MANUALLY (generated by `site.config.ts` -> `statistics.enable: true`)
386
- * You can use `statistics.readTime.speed` to change the speed of reading time.
387
- * @description:en-US Reading time
388
- * @description:zh-CN 阅读时间
389
- */
390
- readingTime: number;
391
- /**
392
- * @protected
393
- * @see https://valaxy.site/guide/config/#%E9%98%85%E8%AF%BB%E7%BB%9F%E8%AE%A1
394
- * @tutorial ⚠️ DO NOT SET MANUALLY (generated by `site.config.ts` -> `statistics.enable: true`)
395
- * You need enable `statistics` in site config to use this feature.
396
- * @description:en-US Word count
397
- * @description:zh-CN 字数统计
398
- */
399
- wordCount: string;
400
- }
401
9
 
402
10
  type Page = Partial<PageFrontMatter>;
403
11
  type Post = Partial<PostFrontMatter> & {
@@ -1128,4 +736,4 @@ type UserSiteConfig = PartialDeep<SiteConfig>;
1128
736
  type UserValaxyConfig<ThemeConfig = DefaultTheme.Config> = PartialDeep<ValaxyConfig<ThemeConfig>>;
1129
737
 
1130
738
  export { DefaultTheme as D };
1131
- export type { Album as A, BaseFrontMatter as B, ExcerptType as E, FuseListItem as F, LlmsCollapse as L, PartialDeep as P, RuntimeConfig as R, SiteConfig as S, UserSiteConfig as U, ValaxyConfig as V, RedirectItem as a, ValaxyAddon as b, Post as c, LlmsFeatured as d, Page as e, PageFrontMatter as f, Photo as g, Pkg as h, PostFrontMatter as i, RedirectRule as j, SocialLink as k, UserValaxyConfig as l };
739
+ export type { FuseListItem as F, LlmsCollapse as L, PartialDeep as P, RuntimeConfig as R, SiteConfig as S, UserSiteConfig as U, ValaxyConfig as V, RedirectItem as a, ValaxyAddon as b, Post as c, LlmsFeatured as d, Page as e, Pkg as f, RedirectRule as g, SocialLink as h, UserValaxyConfig as i };