valaxy-theme-yun 0.23.6 → 0.24.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/components/YunCategoryChildItem.vue +2 -3
- package/components/YunPostNav.vue +8 -5
- package/components/YunSiteInfo.vue +4 -2
- package/components/author/YunAuthorIntro.vue +3 -1
- package/components/menu/YunNavMenuTitle.vue +4 -1
- package/components/site/YunSiteDescription.vue +3 -1
- package/components/site/YunSiteTitle.vue +5 -2
- package/layouts/post.vue +5 -3
- package/package.json +4 -4
- package/types/index.d.ts +2 -1
@@ -1,6 +1,6 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import type { Post } from 'valaxy'
|
3
|
-
import { isCategoryList } from 'valaxy'
|
3
|
+
import { isCategoryList, tObject } from 'valaxy'
|
4
4
|
import { computed } from 'vue'
|
5
5
|
import { useI18n } from 'vue-i18n'
|
6
6
|
import { useRoute } from 'vue-router'
|
@@ -16,8 +16,7 @@ defineProps<{
|
|
16
16
|
*/
|
17
17
|
const { locale } = useI18n()
|
18
18
|
function getTitle(post: Post | any) {
|
19
|
-
|
20
|
-
return post[`title_${lang}`] ? post[`title_${lang}`] : post.title
|
19
|
+
return tObject(post.title || '', locale.value)
|
21
20
|
}
|
22
21
|
const route = useRoute()
|
23
22
|
const categoryList = computed(() => {
|
@@ -1,20 +1,23 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { usePrevNext } from 'valaxy'
|
2
|
+
import { useLocaleTitle, usePrevNext } from 'valaxy'
|
3
3
|
|
4
4
|
const [prev, next] = usePrevNext()
|
5
|
+
|
6
|
+
const prevTitle = useLocaleTitle(prev)
|
7
|
+
const nextTitle = useLocaleTitle(next)
|
5
8
|
</script>
|
6
9
|
|
7
10
|
<template>
|
8
11
|
<div class="post-nav">
|
9
12
|
<div class="post-nav-item">
|
10
|
-
<RouterLink v-if="prev" class="post-nav-prev" :to="prev.path || ''" :title="
|
13
|
+
<RouterLink v-if="prev" class="post-nav-prev" :to="prev.path || ''" :title="prevTitle">
|
11
14
|
<div class="icon" i-ri-arrow-left-s-line />
|
12
|
-
<span class="title truncate" text="sm">{{
|
15
|
+
<span class="title truncate" text="sm">{{ prevTitle }}</span>
|
13
16
|
</RouterLink>
|
14
17
|
</div>
|
15
18
|
<div class="post-nav-item">
|
16
|
-
<RouterLink v-if="next" :to="next.path || ''" :title="
|
17
|
-
<span class="title truncate" text="sm">{{
|
19
|
+
<RouterLink v-if="next" :to="next.path || ''" :title="nextTitle" class="post-nav-next">
|
20
|
+
<span class="title truncate" text="sm">{{ nextTitle }}</span>
|
18
21
|
<div class="icon" i-ri-arrow-right-s-line />
|
19
22
|
</RouterLink>
|
20
23
|
</div>
|
@@ -1,6 +1,8 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useSiteConfig } from 'valaxy'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
3
4
|
|
5
|
+
const { t } = useI18n()
|
4
6
|
const siteConfig = useSiteConfig()
|
5
7
|
</script>
|
6
8
|
|
@@ -18,10 +20,10 @@ const siteConfig = useSiteConfig()
|
|
18
20
|
class="site-subtitle block"
|
19
21
|
text="xs"
|
20
22
|
>
|
21
|
-
{{ siteConfig.subtitle }}
|
23
|
+
{{ t(siteConfig.subtitle) }}
|
22
24
|
</h4>
|
23
25
|
<div v-if="siteConfig.description" class="site-description">
|
24
|
-
{{ siteConfig.description }}
|
26
|
+
{{ t(siteConfig.description) }}
|
25
27
|
</div>
|
26
28
|
</div>
|
27
29
|
</template>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { useSiteConfig } from 'valaxy'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
3
4
|
|
4
5
|
const siteConfig = useSiteConfig()
|
6
|
+
const { t } = useI18n()
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<template>
|
8
10
|
<div v-if="siteConfig.author.intro" class="site-author-intro" m="t-0 b-4">
|
9
|
-
{{ siteConfig.author.intro }}
|
11
|
+
{{ t(siteConfig.author.intro) }}
|
10
12
|
</div>
|
11
13
|
</template>
|
@@ -1,9 +1,12 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { useFrontmatter, useSiteConfig } from 'valaxy'
|
3
3
|
import { computed, ref, watch } from 'vue'
|
4
|
+
import { useI18n } from 'vue-i18n'
|
4
5
|
import { useRoute, useRouter } from 'vue-router'
|
5
6
|
import { useYunAppStore } from '../../stores'
|
6
7
|
|
8
|
+
const { t } = useI18n()
|
9
|
+
|
7
10
|
const yunApp = useYunAppStore()
|
8
11
|
const fm = useFrontmatter()
|
9
12
|
const siteConfig = useSiteConfig()
|
@@ -68,7 +71,7 @@ function goToLink() {
|
|
68
71
|
</span>
|
69
72
|
</div>
|
70
73
|
<span v-if="showSiteTitle" class="font-light truncate">
|
71
|
-
{{ siteConfig.title }}
|
74
|
+
{{ t(siteConfig.title) }}
|
72
75
|
</span>
|
73
76
|
</div>
|
74
77
|
</template>
|
@@ -1,11 +1,13 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { useSiteConfig } from 'valaxy'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
3
4
|
|
4
5
|
const siteConfig = useSiteConfig()
|
6
|
+
const { t } = useI18n()
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<template>
|
8
10
|
<div v-if="siteConfig.description" class="site-description text-$va-c-text text-sm">
|
9
|
-
{{ siteConfig.description }}
|
11
|
+
{{ t(siteConfig.description) }}
|
10
12
|
</div>
|
11
13
|
</template>
|
@@ -1,5 +1,6 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { useSiteConfig } from 'valaxy'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
3
4
|
import { useRouter } from 'vue-router'
|
4
5
|
import { useThemeConfig } from '../../composables'
|
5
6
|
|
@@ -7,6 +8,8 @@ const router = useRouter()
|
|
7
8
|
const siteConfig = useSiteConfig()
|
8
9
|
const themeConfig = useThemeConfig()
|
9
10
|
|
11
|
+
const { t } = useI18n()
|
12
|
+
|
10
13
|
// bg-gradient-to-r gradient-text from-#1e3c72 to-dark dark:(from-#66a6ff to-blue-500)
|
11
14
|
</script>
|
12
15
|
|
@@ -16,14 +19,14 @@ const themeConfig = useThemeConfig()
|
|
16
19
|
class="site-name text-lg leading-loose"
|
17
20
|
:class="themeConfig.banner.siteNameClass"
|
18
21
|
>
|
19
|
-
{{ siteConfig.title }}
|
22
|
+
{{ t(siteConfig.title) }}
|
20
23
|
</RouterLink>
|
21
24
|
<span
|
22
25
|
v-else
|
23
26
|
class="site-name text-lg leading-loose"
|
24
27
|
:class="themeConfig.banner.siteNameClass"
|
25
28
|
>
|
26
|
-
{{ siteConfig.title }}
|
29
|
+
{{ t(siteConfig.title) }}
|
27
30
|
</span>
|
28
31
|
</template>
|
29
32
|
|
package/layouts/post.vue
CHANGED
@@ -2,15 +2,17 @@
|
|
2
2
|
import { defineArticle, useSchemaOrg } from '@unhead/schema-org/vue'
|
3
3
|
|
4
4
|
import dayjs from 'dayjs'
|
5
|
-
import { useFrontmatter, useSiteConfig } from 'valaxy'
|
5
|
+
import { tObject, useFrontmatter, useSiteConfig } from 'valaxy'
|
6
|
+
import { useI18n } from 'vue-i18n'
|
6
7
|
|
7
8
|
const siteConfig = useSiteConfig()
|
8
9
|
const frontmatter = useFrontmatter()
|
9
10
|
|
11
|
+
const { locale } = useI18n()
|
10
12
|
const article: Parameters<typeof defineArticle>[0] = {
|
11
13
|
'@type': 'BlogPosting',
|
12
|
-
'headline': frontmatter.value.title,
|
13
|
-
'description': frontmatter.value.description,
|
14
|
+
'headline': tObject(frontmatter.value.title || '', locale.value),
|
15
|
+
'description': tObject(frontmatter.value.description || '', locale.value),
|
14
16
|
'author': [
|
15
17
|
{
|
16
18
|
name: siteConfig.value.author.name,
|
package/package.json
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
3
|
"type": "module",
|
4
|
-
"version": "0.
|
4
|
+
"version": "0.24.1",
|
5
5
|
"author": {
|
6
6
|
"email": "me@yunyoujun.cn",
|
7
7
|
"name": "YunYouJun",
|
@@ -24,15 +24,15 @@
|
|
24
24
|
"@ctrl/tinycolor": "^4.1.0",
|
25
25
|
"@explosions/fireworks": "^0.2.0",
|
26
26
|
"@iconify-json/ant-design": "^1.2.5",
|
27
|
-
"@iconify-json/simple-icons": "^1.2.
|
27
|
+
"@iconify-json/simple-icons": "^1.2.42",
|
28
28
|
"@vueuse/motion": "^3.0.3",
|
29
29
|
"animejs": "^4.0.2",
|
30
30
|
"gsap": "^3.13.0",
|
31
|
-
"primevue": "^4.3.
|
31
|
+
"primevue": "^4.3.6"
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/animejs": "^3.1.13",
|
35
|
-
"valaxy": "0.
|
35
|
+
"valaxy": "0.24.1",
|
36
36
|
"valaxy-addon-waline": "0.2.1"
|
37
37
|
},
|
38
38
|
"scripts": {
|