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.
Files changed (47) 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/comments/twikoo.ts +25 -1
  8. package/client/composables/comments/waline.ts +33 -23
  9. package/client/composables/{copy-code.ts → features/copy-code.ts} +0 -0
  10. package/client/composables/features/index.ts +1 -0
  11. package/client/composables/index.ts +2 -1
  12. package/client/composables/outline.ts +1 -1
  13. package/client/composables/post.ts +1 -1
  14. package/client/composables/widgets/aplayer.ts +10 -5
  15. package/client/config.ts +4 -1
  16. package/client/index.ts +2 -0
  17. package/client/modules/nprogress.ts +1 -1
  18. package/client/modules/pinia.ts +1 -1
  19. package/client/modules/valaxy.ts +1 -1
  20. package/client/scaffolds/post.md +6 -0
  21. package/client/styles/common/code.scss +1 -1
  22. package/client/styles/common/scrollbar.scss +1 -1
  23. package/client/{types.ts → types/index.ts} +0 -0
  24. package/client/utils/cdn.ts +1 -0
  25. package/client/utils/index.ts +1 -0
  26. package/dist/{chunk-HP2UOVSL.mjs → chunk-ER6SQ4ZW.mjs} +204 -204
  27. package/dist/{chunk-BTP4CLJN.js → chunk-VGABMGJA.js} +203 -203
  28. package/dist/config-60c840d8.d.ts +202 -0
  29. package/dist/node/cli.js +11 -11
  30. package/dist/node/cli.mjs +11 -11
  31. package/dist/node/index.d.ts +140 -15
  32. package/dist/node/index.js +1 -1
  33. package/dist/node/index.mjs +1 -1
  34. package/dist/types/index.d.ts +154 -10
  35. package/index.d.ts +1 -1
  36. package/package.json +14 -8
  37. package/types/config.ts +218 -0
  38. package/types/data.ts +31 -0
  39. package/types/index.ts +3 -0
  40. package/types/posts.ts +133 -0
  41. package/client/app/data.ts +0 -0
  42. package/client/components/ValaxyRightSidebar.vue +0 -73
  43. package/client/components/ValaxyToc.vue +0 -140
  44. package/client/modules/README.md +0 -11
  45. package/client/pages/README.md +0 -20
  46. package/client/shims.d.ts +0 -42
  47. package/dist/index-df14d281.d.ts +0 -462
@@ -1,26 +1,151 @@
1
- import { U as UserConfig, V as ValaxyConfig, a as ValaxyEntryOptions, b as ValaxyThemeConfig, R as ResolvedValaxyOptions, c as ValaxyServerOptions } from '../index-df14d281.js';
2
- export { R as ResolvedValaxyOptions, a as ValaxyEntryOptions, d as ValaxyPluginOptions, c as ValaxyServerOptions, g as getThemeRoot, i as isPath, r as resolveOptions, e as resolvePluginOptions } from '../index-df14d281.js';
3
- import * as type_fest_source_partial_deep from 'type-fest/source/partial-deep';
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 Pages from 'vite-plugin-pages';
6
+ import { V as ValaxyConfig, U as UserConfig, P as PartialDeep, a as ValaxyThemeConfig } from '../config-60c840d8.js';
7
+ import MarkdownIt from 'markdown-it';
8
+ import { Theme } from 'shiki';
9
+ import Anchor from 'markdown-it-anchor';
10
+ import { KatexOptions } from 'katex';
4
11
  import * as vite from 'vite';
5
12
  import { InlineConfig } from 'vite';
6
- import 'vite-ssg';
7
- import '@vitejs/plugin-vue';
8
- import 'unplugin-vue-components/vite';
9
- import 'unocss/vite';
10
- import 'type-fest';
11
- import 'markdown-it';
12
- import 'shiki';
13
- import 'markdown-it-anchor';
14
- import 'katex';
13
+
14
+ interface BlockItem {
15
+ text?: string;
16
+ icon?: string;
17
+ color?: string;
18
+ }
19
+ interface Blocks {
20
+ tip?: BlockItem;
21
+ warning?: BlockItem;
22
+ danger?: BlockItem;
23
+ info?: BlockItem;
24
+ details?: BlockItem;
25
+ }
26
+
27
+ declare type ThemeOptions = Theme | {
28
+ light: Theme;
29
+ dark: Theme;
30
+ };
31
+ interface MarkdownOptions {
32
+ /**
33
+ * markdown-it options
34
+ */
35
+ options?: MarkdownIt.Options;
36
+ /**
37
+ * config markdown-it
38
+ */
39
+ config?: (md: MarkdownIt) => void;
40
+ anchor?: {
41
+ permalink?: Anchor.AnchorOptions['permalink'];
42
+ };
43
+ toc?: {
44
+ includeLevel?: number[];
45
+ [key: string]: any;
46
+ };
47
+ katex?: KatexOptions;
48
+ /**
49
+ * shiki
50
+ */
51
+ theme?: ThemeOptions;
52
+ /**
53
+ * Custom block configurations
54
+ */
55
+ blocks?: Blocks;
56
+ }
57
+
58
+ interface ValaxyEntryOptions {
59
+ /**
60
+ * theme name
61
+ */
62
+ theme?: string;
63
+ userRoot?: string;
64
+ }
65
+ interface ValaxyPluginOptions {
66
+ vue?: Parameters<typeof Vue>[0];
67
+ components?: Parameters<typeof Components>[0];
68
+ unocss?: VitePluginConfig;
69
+ pages?: Parameters<typeof Pages>[0];
70
+ /**
71
+ * for markdown
72
+ */
73
+ markdown?: MarkdownOptions;
74
+ extendMd?: (ctx: {
75
+ route: any;
76
+ data: Record<string, any>;
77
+ excerpt?: string;
78
+ path: string;
79
+ }) => void;
80
+ }
81
+ interface ResolvedValaxyOptions {
82
+ mode: 'dev' | 'build';
83
+ /**
84
+ * package.json root
85
+ */
86
+ pkgRoot: string;
87
+ /**
88
+ * Client root path
89
+ * @default 'valaxy/client'
90
+ */
91
+ clientRoot: string;
92
+ /**
93
+ * User root path
94
+ * @default process.cwd()
95
+ */
96
+ userRoot: string;
97
+ /**
98
+ * Theme root path
99
+ */
100
+ themeRoot: string;
101
+ /**
102
+ * Theme name
103
+ */
104
+ roots: string[];
105
+ theme: string;
106
+ /**
107
+ * Valaxy Config
108
+ */
109
+ config: ValaxyConfig;
110
+ /**
111
+ * config file path
112
+ */
113
+ configFile: string;
114
+ pages: string[];
115
+ }
116
+ interface ValaxyServerOptions {
117
+ onConfigReload?: (newConfig: ValaxyConfig, config: ValaxyConfig) => void;
118
+ }
119
+ declare function isPath(name: string): boolean;
120
+ /**
121
+ * get theme roots
122
+ * @param name
123
+ * @param entry
124
+ * @returns
125
+ */
126
+ declare function getThemeRoot(name: string, entry: string): string;
127
+ declare function resolveOptions(options: ValaxyEntryOptions, mode?: ResolvedValaxyOptions['mode']): Promise<ResolvedValaxyOptions>;
128
+
129
+ declare module 'vite' {
130
+ interface UserConfig {
131
+ /**
132
+ * Custom internal plugin options for Valaxy (advanced)
133
+ *
134
+ * @see ./options.ts'
135
+ */
136
+ valaxy?: ValaxyPluginOptions;
137
+ ssgOptions?: ViteSSGOptions;
138
+ }
139
+ }
15
140
 
16
141
  /**
17
142
  * Type config helper
18
143
  */
19
- declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): type_fest_source_partial_deep.PartialObjectDeep<ValaxyConfig<ThemeConfig>>;
144
+ declare function defineConfig<ThemeConfig>(config: UserConfig<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
20
145
  /**
21
146
  * Type config helper for custom theme config
22
147
  */
23
- declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): type_fest_source_partial_deep.PartialObjectDeep<ValaxyConfig<ThemeConfig>>;
148
+ declare function defineConfigWithTheme<ThemeConfig>(config: UserConfig<ThemeConfig>): PartialDeep<ValaxyConfig<ThemeConfig>>;
24
149
  declare function resolveConfig(options?: ValaxyEntryOptions): Promise<{
25
150
  config: ValaxyConfig<ValaxyThemeConfig>;
26
151
  configFile: string;
@@ -29,4 +154,4 @@ declare function resolveConfig(options?: ValaxyEntryOptions): Promise<{
29
154
 
30
155
  declare function createServer(options: ResolvedValaxyOptions, viteConfig?: InlineConfig, serverOptions?: ValaxyServerOptions): Promise<vite.ViteDevServer>;
31
156
 
32
- export { createServer, defineConfig, defineConfigWithTheme, resolveConfig };
157
+ export { ResolvedValaxyOptions, ValaxyEntryOptions, ValaxyPluginOptions, ValaxyServerOptions, createServer, defineConfig, defineConfigWithTheme, getThemeRoot, isPath, resolveConfig, resolveOptions };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkBTP4CLJNjs = require('../chunk-BTP4CLJN.js');exports.createServer = _chunkBTP4CLJNjs.p; exports.defineConfig = _chunkBTP4CLJNjs.e; exports.defineConfigWithTheme = _chunkBTP4CLJNjs.f; exports.getThemeRoot = _chunkBTP4CLJNjs.j; exports.isPath = _chunkBTP4CLJNjs.i; exports.resolveConfig = _chunkBTP4CLJNjs.g; exports.resolveOptions = _chunkBTP4CLJNjs.k; exports.resolvePluginOptions = _chunkBTP4CLJNjs.l;
1
+ "use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkVGABMGJAjs = require('../chunk-VGABMGJA.js');exports.createServer = _chunkVGABMGJAjs.n; exports.defineConfig = _chunkVGABMGJAjs.e; exports.defineConfigWithTheme = _chunkVGABMGJAjs.f; exports.getThemeRoot = _chunkVGABMGJAjs.j; exports.isPath = _chunkVGABMGJAjs.i; exports.resolveConfig = _chunkVGABMGJAjs.g; exports.resolveOptions = _chunkVGABMGJAjs.k;
@@ -1 +1 @@
1
- import{e as o,f as r,g as e,i as f,j as m,k as p,l as t,p as x}from"../chunk-HP2UOVSL.mjs";export{x as createServer,o as defineConfig,r as defineConfigWithTheme,m as getThemeRoot,f as isPath,e as resolveConfig,p as resolveOptions,t as resolvePluginOptions};
1
+ import{e as o,f as r,g as m,i as p,j as t,k as e,n as f}from"../chunk-ER6SQ4ZW.mjs";export{f as createServer,o as defineConfig,r as defineConfigWithTheme,t as getThemeRoot,p as isPath,m as resolveConfig,e as resolveOptions};
@@ -1,10 +1,154 @@
1
- import 'vite-ssg';
2
- export { A as AlgoliaSearchOptions, j as HeadConfig, H as Header, f as PageData, h as PageDataPayload, P as Post, S as SocialLink, U as UserConfig, V as ValaxyConfig, b as ValaxyThemeConfig } from '../index-df14d281.js';
3
- import '@vitejs/plugin-vue';
4
- import 'unplugin-vue-components/vite';
5
- import 'unocss/vite';
6
- import 'type-fest';
7
- import 'markdown-it';
8
- import 'shiki';
9
- import 'markdown-it-anchor';
10
- import 'katex';
1
+ export { A as AlgoliaSearchOptions, P as PartialDeep, S as SocialLink, U as UserConfig, V as ValaxyConfig, a as ValaxyThemeConfig } from '../config-60c840d8.js';
2
+
3
+ interface Post extends Record<string, any> {
4
+ /**
5
+ * Path of post
6
+ * route.path
7
+ * @description 路径
8
+ */
9
+ path?: string;
10
+ /**
11
+ * Title
12
+ * @description 文章标题
13
+ */
14
+ title?: string;
15
+ date?: string | number | Date;
16
+ /**
17
+ * Updated Time
18
+ */
19
+ updated?: string | number | Date;
20
+ lang?: string;
21
+ /**
22
+ * TODO
23
+ * Read Time
24
+ * @description 阅读时长
25
+ */
26
+ duration?: string;
27
+ /**
28
+ * post card type, can be bilibili/yuque/...
29
+ */
30
+ type?: string;
31
+ /**
32
+ * override url, and jump directly
33
+ */
34
+ url?: string;
35
+ /**
36
+ * @description 摘要
37
+ */
38
+ excerpt?: string;
39
+ /**
40
+ * @description Author
41
+ * @description:zh-CN 作者
42
+ */
43
+ author?: string;
44
+ /**
45
+ * Display sponsor info
46
+ * @description 是否开启赞助
47
+ */
48
+ sponsor?: boolean;
49
+ /**
50
+ * Copyright
51
+ * @description 是否显示文章底部版权信息
52
+ */
53
+ copyright?: boolean;
54
+ /**
55
+ * Category
56
+ * @description 分类,若为数组,则按顺序代表多层文件夹
57
+ */
58
+ categories?: string | string[];
59
+ /**
60
+ * Tags
61
+ * @description 标签,可以有多个
62
+ */
63
+ tags?: string[];
64
+ /**
65
+ * display prev next
66
+ * @description 是否显示前一篇、后一篇导航
67
+ */
68
+ nav?: boolean;
69
+ /**
70
+ * display right sidebar
71
+ * @description 是否显示右侧侧边栏
72
+ */
73
+ aside?: boolean;
74
+ /**
75
+ * icon before title
76
+ */
77
+ icon?: string;
78
+ /**
79
+ * title color
80
+ */
81
+ color?: string;
82
+ /**
83
+ * display comment
84
+ */
85
+ comment?: boolean;
86
+ /**
87
+ * post is end
88
+ * @description 是否完结,将在末尾添加衬线字体 Q.E.D.
89
+ */
90
+ end?: boolean;
91
+ /**
92
+ * use aplayer
93
+ */
94
+ aplayer?: boolean;
95
+ /**
96
+ * use katex
97
+ */
98
+ katex?: boolean;
99
+ /**
100
+ * use codepen
101
+ */
102
+ codepen?: boolean;
103
+ /**
104
+ * 置顶
105
+ */
106
+ top?: number;
107
+ /**
108
+ * display toc
109
+ * @description 是否显示目录
110
+ */
111
+ toc?: boolean;
112
+ /**
113
+ * is draft
114
+ * @description 是否为草稿
115
+ */
116
+ draft?: boolean;
117
+ /**
118
+ * cover
119
+ * @description 封面图片
120
+ */
121
+ cover?: string;
122
+ /**
123
+ * enable markdown-body class
124
+ * @description 是否启用默认的 markdown 样式
125
+ */
126
+ markdown?: boolean;
127
+ }
128
+
129
+ interface Header {
130
+ level: number;
131
+ title: string;
132
+ slug: string;
133
+ /**
134
+ * i18n
135
+ */
136
+ lang?: string;
137
+ }
138
+ interface PageData {
139
+ path: string;
140
+ relativePath: string;
141
+ title: string;
142
+ titleTemplate?: string;
143
+ description: string;
144
+ headers: Header[];
145
+ frontmatter: Post;
146
+ lastUpdated?: number;
147
+ }
148
+ interface PageDataPayload {
149
+ path: string;
150
+ pageData: PageData;
151
+ }
152
+ declare type HeadConfig = [string, Record<string, string>] | [string, Record<string, string>, string];
153
+
154
+ export { HeadConfig, Header, PageData, PageDataPayload, Post };
package/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  // re-export @vueuse/shared types. with strict installers like pnpm, user won't
2
- // be able to reference vite/client in project root.
2
+ // be able to reference @vueuse/shared in project root.
3
3
  /// <reference types="@vueuse/shared" />
4
4
 
5
5
  export * from './client/index'
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy",
3
- "version": "0.7.7",
3
+ "version": "0.8.1",
4
4
  "description": "📄 Vite & Vue powered static blog generator.",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -22,11 +22,17 @@
22
22
  "import": "./dist/node/index.mjs"
23
23
  },
24
24
  "./client/*": "./client/*",
25
+ "./client": {
26
+ "types": "./dist/client/index.d.ts",
27
+ "require": "./dist/client/index.js",
28
+ "import": "./dist/client/index.mjs"
29
+ },
25
30
  "./node": {
26
31
  "types": "./dist/node/index.d.ts",
27
32
  "require": "./dist/node/index.js",
28
33
  "import": "./dist/node/index.mjs"
29
34
  },
35
+ "./types": "./dist/types/index.d.ts",
30
36
  "./*": "./*"
31
37
  },
32
38
  "main": "dist/node/index.js",
@@ -40,7 +46,8 @@
40
46
  "index.d.ts",
41
47
  "bin",
42
48
  "dist",
43
- "client"
49
+ "client",
50
+ "types"
44
51
  ],
45
52
  "engines": {
46
53
  "node": ">=14.0.0"
@@ -48,8 +55,6 @@
48
55
  "dependencies": {
49
56
  "@antfu/utils": "^0.5.2",
50
57
  "@ctrl/tinycolor": "^3.4.1",
51
- "@docsearch/css": "^3.1.1",
52
- "@docsearch/js": "^3.1.1",
53
58
  "@iconify-json/carbon": "^1.1.6",
54
59
  "@iconify-json/ri": "^1.1.3",
55
60
  "@intlify/vite-plugin-vue-i18n": "^3.4.0",
@@ -60,6 +65,7 @@
60
65
  "critters": "^0.0.16",
61
66
  "cross-spawn": "^7.0.3",
62
67
  "dayjs": "^1.11.3",
68
+ "ejs": "^3.1.8",
63
69
  "escape-html": "^1.0.3",
64
70
  "feed": "^4.2.2",
65
71
  "global-dirs": "^3.0.0",
@@ -83,7 +89,7 @@
83
89
  "shiki": "^0.10.1",
84
90
  "star-markdown-css": "^0.4.0",
85
91
  "unconfig": "^0.3.5",
86
- "unocss": "^0.43.2",
92
+ "unocss": "^0.44.0",
87
93
  "unplugin-vue-components": "^0.21.1",
88
94
  "vite": "^2.9.14",
89
95
  "vite-plugin-inspect": "^0.5.1",
@@ -98,15 +104,15 @@
98
104
  },
99
105
  "devDependencies": {
100
106
  "@types/cross-spawn": "^6.0.2",
107
+ "@types/ejs": "^3.1.1",
101
108
  "@types/katex": "^0.14.0",
102
- "@types/lru-cache": "^7.10.10",
109
+ "@types/markdown-it": "^12.2.3",
103
110
  "@types/markdown-it-link-attributes": "^3.0.1",
104
111
  "@types/nprogress": "^0.2.0",
105
112
  "@types/yargs": "^17.0.10",
106
113
  "debug": "^4.3.4",
107
114
  "diacritics": "^1.3.0",
108
- "https-localhost": "^4.7.1",
109
- "type-fest": "^2.16.0"
115
+ "https-localhost": "^4.7.1"
110
116
  },
111
117
  "scripts": {
112
118
  "build": "rimraf dist && tsup --splitting",
@@ -0,0 +1,218 @@
1
+ export type ValaxyThemeConfig = Record<string, any>
2
+
3
+ export interface SocialLink {
4
+ /**
5
+ * The title of your link
6
+ */
7
+ name: string
8
+ link: string
9
+ /**
10
+ * 图标名称
11
+ * https://icones.js.org/
12
+ */
13
+ icon: string
14
+ color: string
15
+ }
16
+
17
+ export interface AlgoliaSearchOptions {
18
+ enable: boolean
19
+ appId: string
20
+ apiKey: string
21
+ indexName: string
22
+ placeholder?: string
23
+ searchParameters?: any
24
+ disableUserPersonalization?: boolean
25
+ initialQuery?: string
26
+ }
27
+
28
+ // packages/valaxy/node/config.ts
29
+ export interface ValaxyConfig<T = ValaxyThemeConfig> {
30
+ /**
31
+ * Default language
32
+ * @description 默认语言
33
+ * @default 'en'
34
+ */
35
+ lang: string
36
+ /**
37
+ * You site url in web, required for ssg & rss
38
+ * @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
39
+ * @default '/'
40
+ */
41
+ url: string
42
+ /**
43
+ * Site title
44
+ * @description 站点标题
45
+ */
46
+ title: string
47
+ /**
48
+ * 副标题
49
+ */
50
+ subtitle: string
51
+ /**
52
+ * 站点描述
53
+ */
54
+ description: string
55
+ /**
56
+ * The owner of this blog
57
+ * @description 博客作者
58
+ */
59
+ author: {
60
+ /**
61
+ * Your name
62
+ * @description 你的名字
63
+ */
64
+ name: string
65
+ email: string
66
+ link: string
67
+ avatar: string
68
+ /**
69
+ * The status of you
70
+ * @description 状态
71
+ */
72
+ status: {
73
+ emoji: string
74
+ /**
75
+ * show when hover emoji
76
+ * @description 当鼠标悬浮在图标上时显示
77
+ */
78
+ message: string
79
+ }
80
+ }
81
+
82
+ /**
83
+ * show last updated time by git
84
+ */
85
+ lastUpdated: boolean
86
+
87
+ /**
88
+ * icon for your website
89
+ */
90
+ favicon: string
91
+
92
+ feed: {
93
+ /**
94
+ * name: feed -> feed.xml / feed.atom / feed.json
95
+ * @default '' -> feed.xml / atom.xml / feed.json
96
+ */
97
+ name: string
98
+ favicon: string
99
+ }
100
+
101
+ /**
102
+ * 社交链接
103
+ */
104
+ social: SocialLink[]
105
+
106
+ /**
107
+ * search
108
+ */
109
+ search: {
110
+ enable: boolean
111
+ algolia: AlgoliaSearchOptions
112
+ }
113
+
114
+ /**
115
+ * comment: waline/...
116
+ */
117
+ comment: {
118
+ enable: boolean
119
+ waline: {
120
+ enable: boolean
121
+ serverURL: string
122
+ }
123
+ twikoo: {
124
+ enable: boolean
125
+ envId: string
126
+ }
127
+ }
128
+
129
+ /**
130
+ * Markdown Feature
131
+ */
132
+ features: {
133
+ /**
134
+ * enable katex for global
135
+ */
136
+ katex: boolean
137
+ }
138
+
139
+ /**
140
+ * third-party plugin need cdn
141
+ * aplayer, twikoo
142
+ * @default 'https://npm.elemecdn.com/'
143
+ */
144
+ cdn: {
145
+ prefix: string
146
+ }
147
+
148
+ /**
149
+ * The name of theme
150
+ * @description 主题名称
151
+ */
152
+ theme: string
153
+ /**
154
+ * The config of theme
155
+ * @description 主题配置
156
+ */
157
+ themeConfig: T & {
158
+ pkg: {
159
+ name: string
160
+ version: string
161
+ homepage?: string
162
+ [key: string]: any
163
+ }
164
+ }
165
+
166
+ /**
167
+ * The license of your posts
168
+ * @description 文章所使用的协议,默认使用 Creative Commons
169
+ * @default https://creativecommons.org/licenses/
170
+ */
171
+ license: {
172
+ /**
173
+ * Whether to show at the bottom of the article
174
+ * @description 是否显示在文章底部
175
+ * @default true
176
+ */
177
+ enabled: boolean
178
+ /**
179
+ * Creative License Language, same with your config.lang
180
+ * when lang === 'zh-CN', use 'zh'
181
+ * @description 默认与站点语言相同
182
+ * @default 'en'
183
+ */
184
+ language: string
185
+ /**
186
+ * Type of license
187
+ * @description 证书类型
188
+ * @default 'by-nc-sa'
189
+ */
190
+ type: 'zero' | 'by-sa' | 'by-nd' | 'by-nc' | 'by-nc-sa' | 'by-nc-nd'
191
+ }
192
+
193
+ /**
194
+ * donate for author
195
+ * @description 打赏/赞助
196
+ */
197
+ sponsor: {
198
+ enable: boolean
199
+ title: string
200
+ methods: {
201
+ name: string
202
+ url: string
203
+ color: string
204
+ icon: string
205
+ }[]
206
+ }
207
+ }
208
+
209
+ export type PartialDeep<T> = {
210
+ [P in keyof T]?: T[P] extends object ? PartialDeep<T[P]> : T[P]
211
+ }
212
+
213
+ /**
214
+ * Valaxy User Config
215
+ * @description Valaxy 用户配置
216
+ */
217
+ export type UserConfig<ThemeConfig = ValaxyThemeConfig> = PartialDeep<ValaxyConfig<ThemeConfig>>
218
+
package/types/data.ts ADDED
@@ -0,0 +1,31 @@
1
+ import type { Post } from './posts'
2
+
3
+ export interface Header {
4
+ level: number
5
+ title: string
6
+ slug: string
7
+ /**
8
+ * i18n
9
+ */
10
+ lang?: string
11
+ }
12
+
13
+ export interface PageData {
14
+ path: string
15
+ relativePath: string
16
+ title: string
17
+ titleTemplate?: string
18
+ description: string
19
+ headers: Header[]
20
+ frontmatter: Post
21
+ lastUpdated?: number
22
+ }
23
+
24
+ export interface PageDataPayload {
25
+ path: string
26
+ pageData: PageData
27
+ }
28
+
29
+ export type HeadConfig =
30
+ | [string, Record<string, string>]
31
+ | [string, Record<string, string>, string]
package/types/index.ts ADDED
@@ -0,0 +1,3 @@
1
+ export * from './config'
2
+ export * from './data'
3
+ export * from './posts'