valaxy-theme-press 0.25.0 → 0.25.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.
@@ -1,8 +1,7 @@
1
1
  <script setup lang="ts">
2
- import { tObject, useFrontmatter, useSiteStore } from 'valaxy'
2
+ import { useFrontmatter, useSiteStore, useValaxyI18n } from 'valaxy'
3
3
  import { computed } from 'vue'
4
4
 
5
- import { useI18n } from 'vue-i18n'
6
5
  import { useRoute } from 'vue-router'
7
6
 
8
7
  const frontmatter = useFrontmatter()
@@ -17,8 +16,8 @@ function findCurrentIndex() {
17
16
  const nextPost = computed(() => site.postList[findCurrentIndex() - 1])
18
17
  const prevPost = computed(() => site.postList[findCurrentIndex() + 1])
19
18
 
20
- const { locale } = useI18n()
21
- const $title = computed(() => tObject(frontmatter.value.title || '', locale.value))
19
+ const { $tO } = useValaxyI18n()
20
+ const $title = computed(() => $tO(frontmatter.value.title))
22
21
  </script>
23
22
 
24
23
  <template>
@@ -70,7 +69,7 @@ const $title = computed(() => tObject(frontmatter.value.title || '', locale.valu
70
69
  </h2>
71
70
  <div class="link">
72
71
  <RouterLink :to="nextPost.href">
73
- {{ tObject(nextPost.title || '', locale) }}
72
+ {{ $tO(nextPost.title) }}
74
73
  </RouterLink>
75
74
  </div>
76
75
  </div>
@@ -80,7 +79,7 @@ const $title = computed(() => tObject(frontmatter.value.title || '', locale.valu
80
79
  </h2>
81
80
  <div class="link">
82
81
  <RouterLink :to="prevPost.href">
83
- {{ tObject(prevPost.title || '', locale) }}
82
+ {{ $tO(prevPost.title) }}
84
83
  </RouterLink>
85
84
  </div>
86
85
  </div>
@@ -1,13 +1,12 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Post } from 'valaxy'
3
- import { tObject } from 'valaxy'
4
- import { useI18n } from 'vue-i18n'
3
+ import { useValaxyI18n } from 'valaxy'
5
4
 
6
5
  defineProps<{
7
6
  post: Post
8
7
  }>()
9
8
 
10
- const { locale } = useI18n()
9
+ const { $tO } = useValaxyI18n()
11
10
  </script>
12
11
 
13
12
  <template>
@@ -17,7 +16,7 @@ const { locale } = useI18n()
17
16
  <div class="space-y-6">
18
17
  <h2 class="text-2xl leading-8 font-bold tracking-tight">
19
18
  <RouterLink class="text-gray-900" :to="post.path || ''">
20
- {{ tObject(post.title || '', locale) }}
19
+ {{ $tO(post.title) }}
21
20
  </RouterLink>
22
21
  </h2>
23
22
  <div
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
- import type { Category, Post } from 'valaxy'
3
- import { isCategoryList, tObject } from 'valaxy'
2
+ import type { Category } from 'valaxy'
3
+ import { isCategoryList, useValaxyI18n } from 'valaxy'
4
4
  import { ref } from 'vue'
5
5
  import { useI18n } from 'vue-i18n'
6
6
 
@@ -19,12 +19,8 @@ const props = withDefaults(defineProps<{
19
19
  })
20
20
 
21
21
  const collapsable = ref(props.collapsable)
22
- const { t, locale } = useI18n()
23
-
24
- function getTitle(post: Post | any) {
25
- const lang = locale.value
26
- return tObject(post.title || '', lang)
27
- }
22
+ const { t } = useI18n()
23
+ const { $tO } = useValaxyI18n()
28
24
  </script>
29
25
 
30
26
  <template>
@@ -58,7 +54,7 @@ function getTitle(post: Post | any) {
58
54
  v-if="categoryItem.title" :to="categoryItem.path || ''"
59
55
  class="inline-flex items-center"
60
56
  >
61
- <span class="text ml-1" text="sm">{{ getTitle(categoryItem) }}</span>
57
+ <span class="text ml-1" text="sm">{{ $tO(categoryItem.title) }}</span>
62
58
  </RouterLink>
63
59
  </template>
64
60
 
@@ -1,8 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PageData, Post } from 'valaxy'
3
- import { onClickHref, onContentUpdated, scrollTo, tObject, useFrontmatter, useLayout, useSidebar, useSiteConfig } from 'valaxy'
3
+ import { onClickHref, onContentUpdated, scrollTo, useFrontmatter, useLayout, useSidebar, useSiteConfig, useValaxyI18n } from 'valaxy'
4
4
  import { computed, nextTick } from 'vue'
5
- import { useI18n } from 'vue-i18n'
6
5
  import { useRoute, useRouter } from 'vue-router'
7
6
  import { targetPadding } from '../client'
8
7
 
@@ -18,8 +17,8 @@ const { hasSidebar } = useSidebar()
18
17
  const isHome = useLayout('home')
19
18
  const layout = useLayout()
20
19
 
21
- const { locale } = useI18n()
22
- const $title = computed(() => tObject(frontmatter.value.title || '', locale.value))
20
+ const { $tO } = useValaxyI18n()
21
+ const $title = computed(() => $tO(frontmatter.value.title))
23
22
 
24
23
  const route = useRoute()
25
24
  const router = useRouter()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-press",
3
- "version": "0.25.0",
3
+ "version": "0.25.2",
4
4
  "description": "Docs Theme for Valaxy",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
@@ -26,6 +26,6 @@
26
26
  "@docsearch/js": "^3.9.0"
27
27
  },
28
28
  "devDependencies": {
29
- "valaxy": "0.25.0"
29
+ "valaxy": "0.25.2"
30
30
  }
31
31
  }
package/setup/main.ts CHANGED
@@ -6,9 +6,11 @@ import 'valaxy/client/styles/common/index.scss'
6
6
  import 'vitepress/dist/client/theme-default/styles/vars.css'
7
7
  import 'vitepress/dist/client/theme-default/styles/icons.css'
8
8
 
9
+ // with custom block title
10
+ import 'valaxy/client/styles/components/custom-block.scss'
9
11
  // import 'vitepress/dist/client/theme-default/styles/base.css'
10
12
  // import 'vitepress/dist/client/theme-default/styles/utils.css'
11
- import 'vitepress/dist/client/theme-default/styles/components/custom-block.css'
13
+ // import 'vitepress/dist/client/theme-default/styles/components/custom-block.css'
12
14
  import 'vitepress/dist/client/theme-default/styles/components/vp-code.css'
13
15
  import 'vitepress/dist/client/theme-default/styles/components/vp-code-group.css'
14
16
  import 'vitepress/dist/client/theme-default/styles/components/vp-doc.css'