valaxy 0.6.3 → 0.7.2

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 (68) 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/main.ts +3 -0
  5. package/client/setup/main.ts +11 -0
  6. package/client/setups.ts +16 -0
  7. package/client/styles/common/custom-blocks.scss +7 -0
  8. package/client/styles/common/markdown.scss +0 -4
  9. package/dist/chunk-35O5DRGK.mjs +2270 -0
  10. package/dist/chunk-4VSND5ZW.mjs +1 -0
  11. package/dist/chunk-CDIW2WTI.js +1 -0
  12. package/dist/chunk-RGBLPQZ2.js +2270 -0
  13. package/dist/{index.d.ts → client/index.d.ts} +16 -160
  14. package/dist/client/index.js +1 -0
  15. package/dist/client/index.mjs +1 -0
  16. package/dist/index-a6b0a69b.d.ts +16 -0
  17. package/dist/{config-112ac884.d.ts → index-afca77df.d.ts} +223 -6
  18. package/dist/node/cli.js +13 -8
  19. package/dist/node/cli.mjs +13 -8
  20. package/dist/node/index.d.ts +13 -35
  21. package/dist/node/index.js +1 -1
  22. package/dist/node/index.mjs +1 -1
  23. package/dist/types/index.d.ts +10 -0
  24. package/dist/types/index.js +1 -0
  25. package/dist/types/index.mjs +0 -0
  26. package/package.json +27 -22
  27. package/shared/index.ts +19 -0
  28. package/config/index.ts +0 -18
  29. package/dist/chunk-4TQV23CA.mjs +0 -40
  30. package/dist/chunk-C4MEVIMD.js +0 -40
  31. package/dist/chunk-EAN2KU6W.mjs +0 -1
  32. package/dist/chunk-U5OMNIOK.js +0 -1
  33. package/dist/index.js +0 -1
  34. package/dist/index.mjs +0 -1
  35. package/index.ts +0 -3
  36. package/node/build.ts +0 -31
  37. package/node/cli.ts +0 -192
  38. package/node/config.ts +0 -156
  39. package/node/index.ts +0 -1
  40. package/node/markdown/check.ts +0 -14
  41. package/node/markdown/highlight.ts +0 -38
  42. package/node/markdown/index.ts +0 -109
  43. package/node/markdown/markdown-it/container.ts +0 -61
  44. package/node/markdown/markdown-it/headings.ts +0 -32
  45. package/node/markdown/markdown-it/highlightLines.ts +0 -96
  46. package/node/markdown/markdown-it/katex.ts +0 -210
  47. package/node/markdown/markdown-it/parseHeader.ts +0 -72
  48. package/node/markdown/markdownToVue.ts +0 -277
  49. package/node/markdown/slugify.ts +0 -24
  50. package/node/options.ts +0 -108
  51. package/node/plugins/extendConfig.ts +0 -46
  52. package/node/plugins/index.ts +0 -224
  53. package/node/plugins/preset.ts +0 -186
  54. package/node/plugins/unocss.ts +0 -110
  55. package/node/plugins/valaxy.ts +0 -1
  56. package/node/rss.ts +0 -127
  57. package/node/server.ts +0 -23
  58. package/node/shims.d.ts +0 -33
  59. package/node/utils/cli.ts +0 -103
  60. package/node/utils/getGitTimestamp.ts +0 -13
  61. package/node/utils/index.ts +0 -59
  62. package/node/utils/net.ts +0 -20
  63. package/node/vite.ts +0 -52
  64. package/tsup.config.ts +0 -25
  65. package/types/config.ts +0 -217
  66. package/types/data.ts +0 -31
  67. package/types/index.ts +0 -3
  68. 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" :class="post.cover && 'max-h-54'" w="full">
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'
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