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