valaxy 0.1.0 → 0.2.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.
- package/bin/valaxy.js +1 -1
- package/dist/chunk-4LP5LOFC.js +86 -0
- package/dist/chunk-BDKTP6RW.js +1 -0
- package/dist/chunk-UVMBC7I3.mjs +1 -0
- package/dist/chunk-VLZSM7W4.mjs +86 -0
- package/dist/config-24b4f209.d.ts +188 -0
- package/dist/index.d.ts +316 -151
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/dist/{cli.d.ts → node/cli.d.ts} +0 -0
- package/dist/node/cli.js +45 -0
- package/dist/node/cli.mjs +45 -0
- package/dist/node/index.d.ts +46 -0
- package/dist/node/index.js +1 -0
- package/dist/node/index.mjs +1 -0
- package/package.json +22 -18
- package/src/client/components/PostCard.vue +1 -1
- package/src/client/components/PostList.vue +5 -5
- package/src/client/components/ValaxyCopyright.vue +1 -1
- package/src/client/components/ValaxyFooter.vue +1 -1
- package/src/client/components/ValaxyOverlay.vue +4 -4
- package/src/client/components/ValaxyPagination.vue +16 -14
- package/src/client/components/ValaxyRightSidebar.vue +4 -4
- package/src/client/components/ValaxySidebar.vue +4 -8
- package/src/client/components/ValaxyToc.vue +11 -9
- package/src/client/composables/comments/index.ts +1 -0
- package/src/client/composables/comments/twikoo.ts +37 -0
- package/src/client/composables/comments/waline.ts +8 -5
- package/src/client/composables/common.ts +3 -4
- package/src/client/composables/search/algolia.ts +2 -1
- package/src/client/composables/sidebar.ts +2 -2
- package/src/client/composables/tag.ts +9 -2
- package/src/client/composables/widgets/backToTop.ts +10 -4
- package/src/client/main.ts +1 -8
- package/src/client/modules/valaxy.ts +36 -15
- package/src/client/shims.d.ts +5 -5
- package/src/client/styles/common/button.scss +3 -5
- package/src/client/styles/common/code.scss +157 -0
- package/src/client/styles/common/hamburger.scss +2 -2
- package/src/client/styles/common/markdown.scss +6 -5
- package/src/client/styles/common/sidebar.scss +3 -3
- package/src/client/styles/common/transition.scss +2 -2
- package/src/client/styles/css-vars.scss +39 -0
- package/src/client/styles/global/helper.scss +2 -2
- package/src/client/styles/global/index.scss +1 -1
- package/src/client/styles/global/nprogress.scss +1 -1
- package/src/client/styles/global/reset.scss +2 -1
- package/src/client/styles/index.scss +12 -1
- package/src/client/styles/mixins/config.scss +1 -1
- package/src/client/styles/mixins/index.scss +1 -0
- package/src/client/styles/palette.scss +6 -8
- package/src/client/styles/vars.scss +1 -13
- package/src/client/styles/widgets/banner.scss +2 -2
- package/src/client/utils/index.ts +0 -2
- package/src/node/build.ts +20 -1
- package/src/node/cli.ts +32 -19
- package/src/node/markdown/highlight.ts +50 -0
- package/src/node/markdown/highlightLines.ts +96 -0
- package/src/node/markdown/index.ts +22 -11
- package/src/node/markdown/markdown-it-katex.ts +20 -10
- package/src/node/markdown/parseHeader.ts +4 -2
- package/src/node/options.ts +3 -1
- package/src/node/plugins/index.ts +53 -24
- package/src/node/plugins/markdown.ts +1 -1
- package/src/node/plugins/preset.ts +46 -10
- package/src/node/plugins/unocss.ts +12 -7
- package/src/node/rss.ts +121 -0
- package/src/node/server.ts +1 -1
- package/src/node/shims.d.ts +15 -0
- package/src/node/utils/cli.ts +0 -1
- package/src/node/vite.ts +7 -15
- package/src/types/config.ts +27 -2
- package/tsup.config.ts +1 -0
- package/dist/build-CLF7GOPQ.mjs +0 -1
- package/dist/build-F47TGGER.js +0 -1
- package/dist/chunk-5S6S3FLN.mjs +0 -83
- package/dist/chunk-JORQSKHF.mjs +0 -1
- package/dist/chunk-TOMJSB6R.js +0 -83
- package/dist/chunk-VJNIZVTJ.js +0 -1
- package/dist/cli.js +0 -6
- package/dist/cli.mjs +0 -6
- package/src/client/pages/about/index.md +0 -5
- package/src/client/pages/posts/index.md +0 -5
- package/src/client/styles/css-vars/dark.scss +0 -17
- package/src/client/styles/css-vars/index.scss +0 -18
- package/src/client/styles/css-vars/light.scss +0 -9
package/src/node/server.ts
CHANGED
package/src/node/shims.d.ts
CHANGED
|
@@ -1,3 +1,13 @@
|
|
|
1
|
+
declare module 'escape-html' {
|
|
2
|
+
const def: (str: string) => string
|
|
3
|
+
export default def
|
|
4
|
+
}
|
|
5
|
+
|
|
6
|
+
declare module 'prismjs' {
|
|
7
|
+
const def: any
|
|
8
|
+
export default def
|
|
9
|
+
}
|
|
10
|
+
|
|
1
11
|
declare module 'markdown-it-attrs' {
|
|
2
12
|
const def: any
|
|
3
13
|
export default def
|
|
@@ -18,6 +28,11 @@ declare module 'markdown-it-container' {
|
|
|
18
28
|
export default def
|
|
19
29
|
}
|
|
20
30
|
|
|
31
|
+
declare module 'markdown-it-task-lists' {
|
|
32
|
+
const def: any
|
|
33
|
+
export default def
|
|
34
|
+
}
|
|
35
|
+
|
|
21
36
|
declare module 'diacritics' {
|
|
22
37
|
export const remove: (str: string) => string
|
|
23
38
|
}
|
package/src/node/utils/cli.ts
CHANGED
package/src/node/vite.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import generateSitemap from 'vite-ssg-sitemap'
|
|
2
1
|
import type { InlineConfig } from 'vite'
|
|
3
2
|
import { searchForWorkspaceRoot } from 'vite'
|
|
4
3
|
import type { ResolvedValaxyOptions, ValaxyServerOptions } from './options'
|
|
@@ -7,7 +6,7 @@ import { ViteValaxyPlugins } from './plugins/preset'
|
|
|
7
6
|
|
|
8
7
|
export type Mode = 'dev' | 'build'
|
|
9
8
|
|
|
10
|
-
export function createViteConfig(options: ResolvedValaxyOptions, serverOptions: ValaxyServerOptions = {}
|
|
9
|
+
export async function createViteConfig(options: ResolvedValaxyOptions, serverOptions: ValaxyServerOptions = {}): Promise<InlineConfig> {
|
|
11
10
|
const viteConfig: InlineConfig = {
|
|
12
11
|
// remove vue-i18n warnings
|
|
13
12
|
// https://vue-i18n.intlify.dev/guide/advanced/optimization.html#reduce-bundle-size-with-feature-build-flags
|
|
@@ -21,11 +20,14 @@ export function createViteConfig(options: ResolvedValaxyOptions, serverOptions:
|
|
|
21
20
|
// __VUE_I18N_LEGACY_API__: 'false',
|
|
22
21
|
// },
|
|
23
22
|
|
|
23
|
+
// always string
|
|
24
|
+
define: {
|
|
25
|
+
__DEV__: options.mode === 'dev' ? 'true' : 'false',
|
|
26
|
+
},
|
|
27
|
+
|
|
24
28
|
root: options.clientRoot,
|
|
25
|
-
// todo user base
|
|
26
|
-
// base: '/',
|
|
27
29
|
|
|
28
|
-
plugins: ViteValaxyPlugins(options, serverOptions, {}
|
|
30
|
+
plugins: await ViteValaxyPlugins(options, serverOptions, {}),
|
|
29
31
|
|
|
30
32
|
server: {
|
|
31
33
|
fs: {
|
|
@@ -37,16 +39,6 @@ export function createViteConfig(options: ResolvedValaxyOptions, serverOptions:
|
|
|
37
39
|
],
|
|
38
40
|
},
|
|
39
41
|
},
|
|
40
|
-
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
if (mode === 'build') {
|
|
44
|
-
// https://github.com/antfu/vite-ssg
|
|
45
|
-
viteConfig.ssgOptions = {
|
|
46
|
-
script: 'async',
|
|
47
|
-
formatting: 'minify',
|
|
48
|
-
onFinished() { generateSitemap() },
|
|
49
|
-
}
|
|
50
42
|
}
|
|
51
43
|
|
|
52
44
|
return viteConfig
|
package/src/types/config.ts
CHANGED
|
@@ -27,8 +27,8 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
27
27
|
*/
|
|
28
28
|
lang: string
|
|
29
29
|
/**
|
|
30
|
-
* You site url in web, required for ssg
|
|
31
|
-
* @description 站点的 URL,SSG
|
|
30
|
+
* You site url in web, required for ssg & rss
|
|
31
|
+
* @description 站点的 URL,SSG & RSS 需要(譬如生成版权处文章永久链接)
|
|
32
32
|
*/
|
|
33
33
|
url: string
|
|
34
34
|
/**
|
|
@@ -54,6 +54,8 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
54
54
|
* @description 你的名字
|
|
55
55
|
*/
|
|
56
56
|
name: string
|
|
57
|
+
email: string
|
|
58
|
+
link: string
|
|
57
59
|
avatar: string
|
|
58
60
|
/**
|
|
59
61
|
* The status of you
|
|
@@ -69,6 +71,15 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
69
71
|
}
|
|
70
72
|
}
|
|
71
73
|
|
|
74
|
+
feed: {
|
|
75
|
+
/**
|
|
76
|
+
* name: feed -> feed.xml / feed.atom / feed.json
|
|
77
|
+
* @default '' -> feed.xml / atom.xml / feed.json
|
|
78
|
+
*/
|
|
79
|
+
name: string
|
|
80
|
+
favicon: string
|
|
81
|
+
}
|
|
82
|
+
|
|
72
83
|
/**
|
|
73
84
|
* 社交链接
|
|
74
85
|
*/
|
|
@@ -95,6 +106,10 @@ export interface ValaxyConfig<T = ValaxyThemeConfig> {
|
|
|
95
106
|
enable: boolean
|
|
96
107
|
serverURL: string
|
|
97
108
|
}
|
|
109
|
+
twikoo: {
|
|
110
|
+
enable: boolean
|
|
111
|
+
envId: string
|
|
112
|
+
}
|
|
98
113
|
}
|
|
99
114
|
|
|
100
115
|
/**
|
|
@@ -175,12 +190,18 @@ export const defaultValaxyConfig: ValaxyConfig = {
|
|
|
175
190
|
subtitle: 'Next Generation Static Blog Framework.',
|
|
176
191
|
author: {
|
|
177
192
|
avatar: 'https://cdn.jsdelivr.net/gh/YunYouJun/yun/images/meme/yun-good-with-bg.jpg',
|
|
193
|
+
email: 'me@yunyoujun.cn',
|
|
194
|
+
link: 'https://www.yunyoujun.cn',
|
|
178
195
|
name: 'YunYouJun',
|
|
179
196
|
status: {
|
|
180
197
|
emoji: '😊',
|
|
181
198
|
message: 'All at sea.',
|
|
182
199
|
},
|
|
183
200
|
},
|
|
201
|
+
feed: {
|
|
202
|
+
name: '',
|
|
203
|
+
favicon: 'favicon.png',
|
|
204
|
+
},
|
|
184
205
|
social: [],
|
|
185
206
|
description: 'A blog generated by Valaxy.',
|
|
186
207
|
|
|
@@ -231,6 +252,10 @@ export const defaultValaxyConfig: ValaxyConfig = {
|
|
|
231
252
|
enable: false,
|
|
232
253
|
serverURL: '',
|
|
233
254
|
},
|
|
255
|
+
twikoo: {
|
|
256
|
+
enable: false,
|
|
257
|
+
envId: 'https://twikoo.vercel.app',
|
|
258
|
+
},
|
|
234
259
|
},
|
|
235
260
|
|
|
236
261
|
theme: 'yun',
|
package/tsup.config.ts
CHANGED
|
@@ -5,6 +5,7 @@ export default defineConfig((options) => {
|
|
|
5
5
|
entry: [
|
|
6
6
|
'src/node/index.ts',
|
|
7
7
|
'src/node/cli.ts',
|
|
8
|
+
'src/index.ts',
|
|
8
9
|
],
|
|
9
10
|
// https://tsup.egoist.sh/#code-splitting
|
|
10
11
|
// Code splitting currently only works with the esm output format, and it's enabled by default. If you want code splitting for cjs output format as well, try using --splitting flag which is an experimental feature to get rid of the limitation in esbuild.
|
package/dist/build-CLF7GOPQ.mjs
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{d as i,j as o}from"./chunk-5S6S3FLN.mjs";i();import{mergeConfig as r,build as f}from"vite";async function a(n,e={}){let t=r(e,o(n));await f(t)}export{a as build};
|
package/dist/build-F47TGGER.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkTOMJSB6Rjs = require('./chunk-TOMJSB6R.js');_chunkTOMJSB6Rjs.d.call(void 0, );var _vite = require('vite');async function a(n,e={}){let t=_vite.mergeConfig.call(void 0, e,_chunkTOMJSB6Rjs.j.call(void 0, n));await _vite.build.call(void 0, t)}exports.build = a;
|