valaxy 0.6.2 → 0.7.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.
- package/client/components/PostCard.vue +26 -29
- package/client/config.ts +1 -1
- package/client/index.ts +5 -0
- package/client/locales/en.yml +18 -17
- package/client/locales/zh-CN.yml +5 -4
- package/client/main.ts +3 -0
- package/client/setup/main.ts +11 -0
- package/client/setups.ts +16 -0
- package/client/styles/common/custom-blocks.scss +7 -0
- package/client/styles/common/markdown.scss +0 -4
- package/dist/chunk-35O5DRGK.mjs +2270 -0
- package/dist/chunk-4VSND5ZW.mjs +1 -0
- package/dist/chunk-CDIW2WTI.js +1 -0
- package/dist/chunk-RGBLPQZ2.js +2270 -0
- package/dist/{index.d.ts → client/index.d.ts} +16 -160
- package/dist/client/index.js +1 -0
- package/dist/client/index.mjs +1 -0
- package/dist/index-a6b0a69b.d.ts +16 -0
- package/dist/{config-112ac884.d.ts → index-afca77df.d.ts} +223 -6
- package/dist/node/cli.js +13 -8
- package/dist/node/cli.mjs +13 -8
- package/dist/node/index.d.ts +13 -35
- package/dist/node/index.js +1 -1
- package/dist/node/index.mjs +1 -1
- package/dist/types/index.d.ts +10 -0
- package/dist/types/index.js +1 -0
- package/dist/types/index.mjs +0 -0
- package/package.json +27 -22
- package/shared/index.ts +19 -0
- package/config/index.ts +0 -18
- package/dist/chunk-23IW567G.mjs +0 -40
- package/dist/chunk-EAN2KU6W.mjs +0 -1
- package/dist/chunk-U5OMNIOK.js +0 -1
- package/dist/chunk-YUC5WP5Y.js +0 -40
- package/dist/index.js +0 -1
- package/dist/index.mjs +0 -1
- package/index.ts +0 -3
- package/node/build.ts +0 -31
- package/node/cli.ts +0 -192
- package/node/config.ts +0 -156
- package/node/index.ts +0 -1
- package/node/markdown/check.ts +0 -14
- package/node/markdown/highlight.ts +0 -38
- package/node/markdown/index.ts +0 -109
- package/node/markdown/markdown-it/container.ts +0 -61
- package/node/markdown/markdown-it/headings.ts +0 -32
- package/node/markdown/markdown-it/highlightLines.ts +0 -96
- package/node/markdown/markdown-it/katex.ts +0 -210
- package/node/markdown/markdown-it/parseHeader.ts +0 -72
- package/node/markdown/markdownToVue.ts +0 -275
- package/node/markdown/slugify.ts +0 -24
- package/node/options.ts +0 -108
- package/node/plugins/extendConfig.ts +0 -46
- package/node/plugins/index.ts +0 -224
- package/node/plugins/preset.ts +0 -186
- package/node/plugins/unocss.ts +0 -110
- package/node/plugins/valaxy.ts +0 -1
- package/node/rss.ts +0 -127
- package/node/server.ts +0 -23
- package/node/shims.d.ts +0 -33
- package/node/utils/cli.ts +0 -103
- package/node/utils/getGitTimestamp.ts +0 -13
- package/node/utils/index.ts +0 -59
- package/node/utils/net.ts +0 -20
- package/node/vite.ts +0 -52
- package/tsup.config.ts +0 -25
- package/types/config.ts +0 -217
- package/types/data.ts +0 -31
- package/types/index.ts +0 -3
- package/types/posts.ts +0 -122
|
@@ -19,39 +19,37 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
|
19
19
|
v-if="post.cover"
|
|
20
20
|
:src="post.cover"
|
|
21
21
|
:alt="t('post.cover')"
|
|
22
|
-
|
|
23
|
-
h="54"
|
|
24
|
-
class="object-cover object-center md:shadow"
|
|
22
|
+
width="320" height="180"
|
|
23
|
+
w="40%" h="54"
|
|
24
|
+
class="cover object-cover object-center md:shadow"
|
|
25
25
|
>
|
|
26
26
|
|
|
27
|
-
<div class="
|
|
28
|
-
<
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
>
|
|
34
|
-
<div class="flex
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
</AppLink>
|
|
27
|
+
<div class="flex flex-col flex-1 items-center" w="full" max-h="54">
|
|
28
|
+
<AppLink
|
|
29
|
+
class="post-title-link"
|
|
30
|
+
:to="post.path || ''"
|
|
31
|
+
m="t-3"
|
|
32
|
+
>
|
|
33
|
+
<div class="flex justify-center items-center title text-2xl" font="serif black">
|
|
34
|
+
<div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />{{ post.title }}
|
|
35
|
+
</div>
|
|
36
|
+
</AppLink>
|
|
38
37
|
|
|
39
|
-
|
|
38
|
+
<YunPostMeta :frontmatter="post" />
|
|
40
39
|
|
|
41
|
-
|
|
42
|
-
|
|
40
|
+
<div v-if="post.excerpt" class="markdown-body" text="left" w="full" p="x-6 lt-sm:4" v-html="post.excerpt" />
|
|
41
|
+
<div m="b-5" />
|
|
43
42
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
</div>
|
|
43
|
+
<a
|
|
44
|
+
v-if="post.url"
|
|
45
|
+
:href="post.url"
|
|
46
|
+
class="post-link-btn shadow hover:shadow-md"
|
|
47
|
+
rounded
|
|
48
|
+
target="_blank"
|
|
49
|
+
m="b-4"
|
|
50
|
+
>
|
|
51
|
+
{{ t('post.view_link') }}
|
|
52
|
+
</a>
|
|
55
53
|
</div>
|
|
56
54
|
</div>
|
|
57
55
|
|
|
@@ -59,7 +57,6 @@ const { icon, styles } = usePostProperty(props.post.type)
|
|
|
59
57
|
<div w="full" class="yun-card-actions flex justify-between" border="t" text="sm">
|
|
60
58
|
<div class="inline-flex">
|
|
61
59
|
<router-link
|
|
62
|
-
v-if="post.categories"
|
|
63
60
|
:to="{
|
|
64
61
|
path: '/categories/',
|
|
65
62
|
query: { category: Array.isArray(post.categories) ? post.categories[post.categories.length - 1] : post.categories },
|
package/client/config.ts
CHANGED
|
@@ -15,7 +15,7 @@ import type { PageData, ValaxyConfig } from '../types'
|
|
|
15
15
|
*/
|
|
16
16
|
function parse<T=any>(data: string): T {
|
|
17
17
|
const parsed = JSON.parse(data)
|
|
18
|
-
return (
|
|
18
|
+
return (__DEV__ ? readonly(parsed) : parsed) as T
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
interface ValaxyContext {
|
package/client/index.ts
CHANGED
package/client/locales/en.yml
CHANGED
|
@@ -3,12 +3,13 @@ button:
|
|
|
3
3
|
back: Back
|
|
4
4
|
go: GO
|
|
5
5
|
home: Home
|
|
6
|
-
|
|
6
|
+
toggle_light: Switch to light mode
|
|
7
|
+
toggle_dark: Switch to dark mode
|
|
7
8
|
toggle_langs: Change languages
|
|
8
9
|
intro:
|
|
9
10
|
desc: Theme Yun | Valaxy
|
|
10
11
|
hi: Hi, {name}!
|
|
11
|
-
not-found: Oops! Space
|
|
12
|
+
not-found: Oops! Space collapsed!
|
|
12
13
|
|
|
13
14
|
title:
|
|
14
15
|
archive: Archive
|
|
@@ -40,8 +41,8 @@ post:
|
|
|
40
41
|
toc_empty: This post does not have a Table of Contents
|
|
41
42
|
views: Views
|
|
42
43
|
comments_count: Comments
|
|
43
|
-
related_posts: Related
|
|
44
|
-
view_link: View
|
|
44
|
+
related_posts: Related posts
|
|
45
|
+
view_link: View link
|
|
45
46
|
read_more: READ MORE
|
|
46
47
|
cover: Cover
|
|
47
48
|
copyright:
|
|
@@ -61,24 +62,24 @@ footer:
|
|
|
61
62
|
total_visitors: Total Visitors
|
|
62
63
|
|
|
63
64
|
counter:
|
|
64
|
-
archives: No
|
|
65
|
-
categories: No
|
|
66
|
-
tags: No
|
|
65
|
+
archives: No posts | 1 post | {count} posts
|
|
66
|
+
categories: No categories | 1 category | {count} categories
|
|
67
|
+
tags: No tags | 1 tag | {count} tags
|
|
67
68
|
albums:
|
|
68
69
|
zero: No album
|
|
69
|
-
one: 1 album
|
|
70
|
-
other: '%d albums
|
|
70
|
+
one: 1 album
|
|
71
|
+
other: '%d albums'
|
|
71
72
|
photos:
|
|
72
73
|
zero: No photo
|
|
73
|
-
one: 1 photo
|
|
74
|
-
other: '%d photos
|
|
74
|
+
one: 1 photo
|
|
75
|
+
other: '%d photos'
|
|
75
76
|
|
|
76
77
|
category:
|
|
77
78
|
uncategorized: Uncategorized
|
|
78
79
|
|
|
79
80
|
search:
|
|
80
81
|
placeholder: Searching...
|
|
81
|
-
empty: 'We
|
|
82
|
+
empty: 'We could not find any results for the search: {query}.'
|
|
82
83
|
hits_time: '{hits} results found in {time} ms'
|
|
83
84
|
|
|
84
85
|
symbol:
|
|
@@ -97,12 +98,12 @@ accessibility:
|
|
|
97
98
|
|
|
98
99
|
wordcount:
|
|
99
100
|
count: Word count in article
|
|
100
|
-
count_total:
|
|
101
|
+
count_total: Total words
|
|
101
102
|
time: Reading time
|
|
102
103
|
time_total: Total reading time
|
|
103
104
|
|
|
104
105
|
time:
|
|
105
|
-
day: Days
|
|
106
|
-
hour: Hours
|
|
107
|
-
minute: Minutes
|
|
108
|
-
second: Seconds
|
|
106
|
+
day: 1 Day | %d Days
|
|
107
|
+
hour: 1 Hour | %d Hours
|
|
108
|
+
minute: 1 Minute | %d Minutes
|
|
109
|
+
second: 1 Second | %d Seconds
|
package/client/locales/zh-CN.yml
CHANGED
|
@@ -3,6 +3,7 @@ button:
|
|
|
3
3
|
back: 返回
|
|
4
4
|
go: 确定
|
|
5
5
|
home: 首页
|
|
6
|
+
toggle_light: 切换亮色模式
|
|
6
7
|
toggle_dark: 切换深色模式
|
|
7
8
|
toggle_langs: 切换语言
|
|
8
9
|
intro:
|
|
@@ -101,7 +102,7 @@ wordcount:
|
|
|
101
102
|
time_total: 站点阅读时长
|
|
102
103
|
|
|
103
104
|
time:
|
|
104
|
-
day: 天
|
|
105
|
-
hour: 小时
|
|
106
|
-
minute: 分
|
|
107
|
-
second: 秒
|
|
105
|
+
day: 1 天 | %d 天
|
|
106
|
+
hour: 1 小时 | %d 小时
|
|
107
|
+
minute: 1 分 | %d 分
|
|
108
|
+
second: 1 秒 | %d 秒
|
package/client/main.ts
CHANGED
|
@@ -9,6 +9,7 @@ import '@unocss/reset/tailwind.css'
|
|
|
9
9
|
import '/@valaxyjs/styles'
|
|
10
10
|
|
|
11
11
|
import 'uno.css'
|
|
12
|
+
import setupMain from './setup/main'
|
|
12
13
|
|
|
13
14
|
const routes = setupLayouts(__DEV__ ? generatedRoutes : generatedRoutes.filter(i => !i.meta?.frontmatter.draft))
|
|
14
15
|
|
|
@@ -26,5 +27,7 @@ export const createApp = ViteSSG(
|
|
|
26
27
|
(ctx) => {
|
|
27
28
|
// install all modules under `modules/`
|
|
28
29
|
Object.values(import.meta.globEager('./modules/*.ts')).forEach(i => i.install?.(ctx))
|
|
30
|
+
|
|
31
|
+
setupMain(ctx)
|
|
29
32
|
},
|
|
30
33
|
)
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/* __imports__ */
|
|
2
|
+
|
|
3
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
|
4
|
+
|
|
5
|
+
export default function setupMain(ctx: ViteSSGContext) {
|
|
6
|
+
// @ts-expect-error inject in runtime
|
|
7
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
8
|
+
const injection_arg = ctx
|
|
9
|
+
|
|
10
|
+
/* __injections__ */
|
|
11
|
+
}
|
package/client/setups.ts
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import type { ViteSSGContext } from 'vite-ssg'
|
|
2
|
+
import type { Awaitable } from '@antfu/utils'
|
|
3
|
+
import type { VitePluginConfig as UnoCssConfig } from 'unocss/vite'
|
|
4
|
+
|
|
5
|
+
type AppContext = ViteSSGContext
|
|
6
|
+
|
|
7
|
+
export type AppSetup = (ctx: AppContext) => Awaitable<void>
|
|
8
|
+
export type UnoSetup = () => Awaitable<Partial<UnoCssConfig> | undefined>
|
|
9
|
+
|
|
10
|
+
export function defineAppSetup(fn: AppSetup) {
|
|
11
|
+
return fn
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export function defineUnoSetup(fn: UnoSetup) {
|
|
15
|
+
return fn
|
|
16
|
+
}
|