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.
Files changed (70) hide show
  1. package/client/components/PostCard.vue +26 -29
  2. package/client/config.ts +1 -1
  3. package/client/index.ts +5 -0
  4. package/client/locales/en.yml +18 -17
  5. package/client/locales/zh-CN.yml +5 -4
  6. package/client/main.ts +3 -0
  7. package/client/setup/main.ts +11 -0
  8. package/client/setups.ts +16 -0
  9. package/client/styles/common/custom-blocks.scss +7 -0
  10. package/client/styles/common/markdown.scss +0 -4
  11. package/dist/chunk-35O5DRGK.mjs +2270 -0
  12. package/dist/chunk-4VSND5ZW.mjs +1 -0
  13. package/dist/chunk-CDIW2WTI.js +1 -0
  14. package/dist/chunk-RGBLPQZ2.js +2270 -0
  15. package/dist/{index.d.ts → client/index.d.ts} +16 -160
  16. package/dist/client/index.js +1 -0
  17. package/dist/client/index.mjs +1 -0
  18. package/dist/index-a6b0a69b.d.ts +16 -0
  19. package/dist/{config-112ac884.d.ts → index-afca77df.d.ts} +223 -6
  20. package/dist/node/cli.js +13 -8
  21. package/dist/node/cli.mjs +13 -8
  22. package/dist/node/index.d.ts +13 -35
  23. package/dist/node/index.js +1 -1
  24. package/dist/node/index.mjs +1 -1
  25. package/dist/types/index.d.ts +10 -0
  26. package/dist/types/index.js +1 -0
  27. package/dist/types/index.mjs +0 -0
  28. package/package.json +27 -22
  29. package/shared/index.ts +19 -0
  30. package/config/index.ts +0 -18
  31. package/dist/chunk-23IW567G.mjs +0 -40
  32. package/dist/chunk-EAN2KU6W.mjs +0 -1
  33. package/dist/chunk-U5OMNIOK.js +0 -1
  34. package/dist/chunk-YUC5WP5Y.js +0 -40
  35. package/dist/index.js +0 -1
  36. package/dist/index.mjs +0 -1
  37. package/index.ts +0 -3
  38. package/node/build.ts +0 -31
  39. package/node/cli.ts +0 -192
  40. package/node/config.ts +0 -156
  41. package/node/index.ts +0 -1
  42. package/node/markdown/check.ts +0 -14
  43. package/node/markdown/highlight.ts +0 -38
  44. package/node/markdown/index.ts +0 -109
  45. package/node/markdown/markdown-it/container.ts +0 -61
  46. package/node/markdown/markdown-it/headings.ts +0 -32
  47. package/node/markdown/markdown-it/highlightLines.ts +0 -96
  48. package/node/markdown/markdown-it/katex.ts +0 -210
  49. package/node/markdown/markdown-it/parseHeader.ts +0 -72
  50. package/node/markdown/markdownToVue.ts +0 -275
  51. package/node/markdown/slugify.ts +0 -24
  52. package/node/options.ts +0 -108
  53. package/node/plugins/extendConfig.ts +0 -46
  54. package/node/plugins/index.ts +0 -224
  55. package/node/plugins/preset.ts +0 -186
  56. package/node/plugins/unocss.ts +0 -110
  57. package/node/plugins/valaxy.ts +0 -1
  58. package/node/rss.ts +0 -127
  59. package/node/server.ts +0 -23
  60. package/node/shims.d.ts +0 -33
  61. package/node/utils/cli.ts +0 -103
  62. package/node/utils/getGitTimestamp.ts +0 -13
  63. package/node/utils/index.ts +0 -59
  64. package/node/utils/net.ts +0 -20
  65. package/node/vite.ts +0 -52
  66. package/tsup.config.ts +0 -25
  67. package/types/config.ts +0 -217
  68. package/types/data.ts +0 -31
  69. package/types/index.ts +0 -3
  70. 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
- w="40%"
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="post-card-image-info-text flex-1" w="full">
28
- <div class="flex flex-col flex-1 justify-center items-center" w="full">
29
- <AppLink
30
- class="post-title-link"
31
- :to="post.path || ''"
32
- m="t-3"
33
- >
34
- <div class="flex justify-center items-center title text-2xl" font="serif black">
35
- <div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />{{ post.title }}
36
- </div>
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
- <YunPostMeta :frontmatter="post" />
38
+ <YunPostMeta :frontmatter="post" />
40
39
 
41
- <div v-if="post.excerpt" class="markdown-body" text="left" w="full" p="x-6 lt-sm:4" v-html="post.excerpt" />
42
- <div m="b-5" />
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
- <a
45
- v-if="post.url"
46
- :href="post.url"
47
- class="post-link-btn shadow hover:shadow-md"
48
- rounded
49
- target="_blank"
50
- m="b-4"
51
- >
52
- {{ t('post.view_link') }}
53
- </a>
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 (import.meta.env.DEV ? readonly(parsed) : parsed) as T
18
+ return (__DEV__ ? readonly(parsed) : parsed) as T
19
19
  }
20
20
 
21
21
  interface ValaxyContext {
package/client/index.ts CHANGED
@@ -2,3 +2,8 @@ export * from './config'
2
2
 
3
3
  export * from './composables'
4
4
  export * from './utils'
5
+
6
+ export * from './setups'
7
+
8
+ // fix client alias export
9
+ export * from '../shared'
@@ -3,12 +3,13 @@ button:
3
3
  back: Back
4
4
  go: GO
5
5
  home: Home
6
- toggle_dark: Toggle dark mode
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 collapse!
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 Posts
44
- view_link: View Link
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 post | 1 post in total | {count} posts in total
65
- categories: No category | 1 category in total | {count} categories in total
66
- tags: No tag | 1 tag in total | {count} tags in total
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 in total
70
- other: '%d albums in total'
70
+ one: 1 album
71
+ other: '%d albums'
71
72
  photos:
72
73
  zero: No photo
73
- one: 1 photo in total
74
- other: '%d photos in total'
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 didn''t find any results for the search: {query}.'
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: Word 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
@@ -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
+ }
@@ -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
+ }
@@ -81,4 +81,11 @@ html.dark {
81
81
  .custom-block-title {
82
82
  margin-bottom: -0.4rem;
83
83
  font-weight: 600;
84
+ display: flex;
85
+ align-items: center;
86
+
87
+ > .icon {
88
+ width: 16px;
89
+ margin-right: 4px;
90
+ }
84
91
  }
@@ -2,10 +2,6 @@
2
2
 
3
3
  .markdown-body {
4
4
  --smc-font-family: var(--va-font-sans);
5
-
6
- video {
7
- margin: auto;
8
- }
9
5
  }
10
6
 
11
7
  // for anchor