valaxy-theme-yun 0.24.1 → 0.24.3

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.
@@ -1,5 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Post } from 'valaxy'
3
+ import { tObject } from 'valaxy'
3
4
  import { computed, ref } from 'vue'
4
5
  import { useI18n } from 'vue-i18n'
5
6
  import { usePostProperty } from '../composables'
@@ -8,7 +9,7 @@ const props = defineProps<{
8
9
  post: Post
9
10
  }>()
10
11
 
11
- const { t } = useI18n()
12
+ const { t, locale } = useI18n()
12
13
 
13
14
  const { icon, styles, color } = usePostProperty(props.post.type)
14
15
 
@@ -19,6 +20,10 @@ const postTitleClass = computed(() => {
19
20
  }
20
21
  return props.post.postTitleClass || gradientClasses.value
21
22
  })
23
+
24
+ const postTitle = computed(() => {
25
+ return tObject(props.post.title || '', locale.value)
26
+ })
22
27
  </script>
23
28
 
24
29
  <template>
@@ -51,7 +56,7 @@ const postTitleClass = computed(() => {
51
56
  text="center" font="serif black"
52
57
  >
53
58
  <div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />
54
- <span>{{ post.title }}</span>
59
+ <span>{{ postTitle }}</span>
55
60
  </div>
56
61
  </AppLink>
57
62
 
@@ -1,8 +1,10 @@
1
1
  <script setup lang="ts">
2
2
  import type { Post } from 'valaxy'
3
3
  import { useMotion } from '@vueuse/motion'
4
- import { formatDate } from 'valaxy'
5
- import { ref } from 'vue'
4
+ import { formatDate, tObject } from 'valaxy'
5
+ import { computed, ref } from 'vue'
6
+
7
+ import { useI18n } from 'vue-i18n'
6
8
 
7
9
  const props = defineProps<{
8
10
  i: number
@@ -26,6 +28,11 @@ useMotion(itemRef, {
26
28
  },
27
29
  },
28
30
  })
31
+
32
+ const { locale } = useI18n()
33
+ const postTitle = computed(() => {
34
+ return tObject(props.post.title || '', locale.value)
35
+ })
29
36
  </script>
30
37
 
31
38
  <template>
@@ -48,7 +55,7 @@ useMotion(itemRef, {
48
55
  </div>
49
56
  <h2 class="post-title w-full" inline-flex items-center font="serif black">
50
57
  <RouterLink :to="post.path || ''" class="post-title-link">
51
- {{ post.title }}
58
+ {{ postTitle }}
52
59
  </RouterLink>
53
60
  </h2>
54
61
  </header>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
3
  "type": "module",
4
- "version": "0.24.1",
4
+ "version": "0.24.3",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
7
7
  "name": "YunYouJun",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/animejs": "^3.1.13",
35
- "valaxy": "0.24.1",
36
- "valaxy-addon-waline": "0.2.1"
35
+ "valaxy-addon-waline": "0.2.1",
36
+ "valaxy": "0.24.3"
37
37
  },
38
38
  "scripts": {
39
39
  "release": "bumpp && pnpm publish"