valaxy-theme-yun 0.25.0 → 0.25.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 +4 -8
- package/components/YunPostCard.vue +6 -9
- package/components/YunPostCollapseItem.vue +4 -9
- package/components/YunSidebarLinks.vue +4 -1
- package/components/menu/YunNavMenuTitle.vue +4 -4
- package/components/prologue/YunPrologueSquare.vue +4 -1
- package/components/site/YunSiteLinkItem.vue +6 -2
- package/components/site/YunSiteSubtitle.vue +3 -2
- package/components/theme/nimbo/YunNimboNavMenu.vue +7 -3
- package/layouts/post.vue +4 -6
- package/package.json +2 -2
- package/styles/main.scss +2 -1
@@ -1,8 +1,6 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import
|
3
|
-
import { isCategoryList, tObject } from 'valaxy'
|
2
|
+
import { isCategoryList, useValaxyI18n } from 'valaxy'
|
4
3
|
import { computed } from 'vue'
|
5
|
-
import { useI18n } from 'vue-i18n'
|
6
4
|
import { useRoute } from 'vue-router'
|
7
5
|
|
8
6
|
defineProps<{
|
@@ -14,10 +12,8 @@ defineProps<{
|
|
14
12
|
/**
|
15
13
|
* i18n
|
16
14
|
*/
|
17
|
-
const {
|
18
|
-
|
19
|
-
return tObject(post.title || '', locale.value)
|
20
|
-
}
|
15
|
+
const { $tO } = useValaxyI18n()
|
16
|
+
|
21
17
|
const route = useRoute()
|
22
18
|
const categoryList = computed(() => {
|
23
19
|
const c = (route.query.category as string) || ''
|
@@ -42,7 +38,7 @@ const categoryList = computed(() => {
|
|
42
38
|
hover="bg-black/5"
|
43
39
|
>
|
44
40
|
<div i-ri-file-text-line />
|
45
|
-
<span
|
41
|
+
<span class="st-text">{{ $tO(categoryItem.title) }}</span>
|
46
42
|
</RouterLink>
|
47
43
|
</template>
|
48
44
|
</template>
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import type { Post } from 'valaxy'
|
3
|
-
import {
|
3
|
+
import { useValaxyI18n } from 'valaxy'
|
4
4
|
import { computed, ref } from 'vue'
|
5
5
|
import { useI18n } from 'vue-i18n'
|
6
6
|
import { usePostProperty } from '../composables'
|
@@ -9,7 +9,8 @@ const props = defineProps<{
|
|
9
9
|
post: Post
|
10
10
|
}>()
|
11
11
|
|
12
|
-
const { t
|
12
|
+
const { t } = useI18n()
|
13
|
+
const { $tO } = useValaxyI18n()
|
13
14
|
|
14
15
|
const { icon, styles, color } = usePostProperty(props.post.type)
|
15
16
|
|
@@ -20,10 +21,6 @@ const postTitleClass = computed(() => {
|
|
20
21
|
}
|
21
22
|
return props.post.postTitleClass || gradientClasses.value
|
22
23
|
})
|
23
|
-
|
24
|
-
const postTitle = computed(() => {
|
25
|
-
return tObject(props.post.title || '', locale.value)
|
26
|
-
})
|
27
24
|
</script>
|
28
25
|
|
29
26
|
<template>
|
@@ -44,7 +41,7 @@ const postTitle = computed(() => {
|
|
44
41
|
loading="lazy"
|
45
42
|
>
|
46
43
|
|
47
|
-
<div class="flex flex-col items-center relative" :class="post.cover && 'h-54'" w="full">
|
44
|
+
<div class="flex flex-col items-center relative px-6" :class="post.cover && 'h-54'" w="full">
|
48
45
|
<AppLink
|
49
46
|
class="post-title-link cursor-pointer"
|
50
47
|
:to="post.path || ''"
|
@@ -56,7 +53,7 @@ const postTitle = computed(() => {
|
|
56
53
|
text="center" font="serif black"
|
57
54
|
>
|
58
55
|
<div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />
|
59
|
-
<span>{{
|
56
|
+
<span>{{ $tO(post.title) }}</span>
|
60
57
|
</div>
|
61
58
|
</AppLink>
|
62
59
|
|
@@ -86,7 +83,7 @@ const postTitle = computed(() => {
|
|
86
83
|
|
87
84
|
<!-- always show -->
|
88
85
|
<div
|
89
|
-
w="full" class="yun-card-actions flex justify-between"
|
86
|
+
w="full" class="yun-card-actions flex justify-between px-6"
|
90
87
|
min-h="10"
|
91
88
|
text="sm"
|
92
89
|
>
|
@@ -1,10 +1,8 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import type { Post } from 'valaxy'
|
3
3
|
import { useMotion } from '@vueuse/motion'
|
4
|
-
import { formatDate,
|
5
|
-
import {
|
6
|
-
|
7
|
-
import { useI18n } from 'vue-i18n'
|
4
|
+
import { formatDate, useValaxyI18n } from 'valaxy'
|
5
|
+
import { ref } from 'vue'
|
8
6
|
|
9
7
|
const props = defineProps<{
|
10
8
|
i: number
|
@@ -29,10 +27,7 @@ useMotion(itemRef, {
|
|
29
27
|
},
|
30
28
|
})
|
31
29
|
|
32
|
-
const {
|
33
|
-
const postTitle = computed(() => {
|
34
|
-
return tObject(props.post.title || '', locale.value)
|
35
|
-
})
|
30
|
+
const { $tO } = useValaxyI18n()
|
36
31
|
</script>
|
37
32
|
|
38
33
|
<template>
|
@@ -55,7 +50,7 @@ const postTitle = computed(() => {
|
|
55
50
|
</div>
|
56
51
|
<h2 class="post-title w-full" inline-flex items-center font="serif black">
|
57
52
|
<RouterLink :to="post.path || ''" class="post-title-link">
|
58
|
-
{{
|
53
|
+
{{ $tO(post.title) }}
|
59
54
|
</RouterLink>
|
60
55
|
</h2>
|
61
56
|
</header>
|
@@ -1,7 +1,9 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
+
import { useValaxyI18n } from 'valaxy'
|
2
3
|
import { useThemeConfig } from '../composables'
|
3
4
|
|
4
5
|
const themeConfig = useThemeConfig()
|
6
|
+
const { $t } = useValaxyI18n()
|
5
7
|
</script>
|
6
8
|
|
7
9
|
<template>
|
@@ -9,7 +11,8 @@ const themeConfig = useThemeConfig()
|
|
9
11
|
<AppLink
|
10
12
|
v-for="item, i in themeConfig.pages" :key="i"
|
11
13
|
class="link-item yun-icon-btn" inline-flex
|
12
|
-
:to="item.url"
|
14
|
+
:to="item.url"
|
15
|
+
:title="$t(item.name)"
|
13
16
|
:style="`color:${item.color}`"
|
14
17
|
>
|
15
18
|
<div :class="item.icon" class="icon size-6" />
|
@@ -1,10 +1,10 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import {
|
2
|
+
import { useFrontmatter, useSiteConfig, useValaxyI18n } from 'valaxy'
|
3
3
|
import { computed, ref, watch } from 'vue'
|
4
4
|
import { useRoute, useRouter } from 'vue-router'
|
5
5
|
import { useYunAppStore } from '../../stores'
|
6
6
|
|
7
|
-
const { $t,
|
7
|
+
const { $t, $tO } = useValaxyI18n()
|
8
8
|
|
9
9
|
const yunApp = useYunAppStore()
|
10
10
|
const fm = useFrontmatter()
|
@@ -63,10 +63,10 @@ function goToLink() {
|
|
63
63
|
class="size-4"
|
64
64
|
:class="fm.icon || 'i-ri-article-line'"
|
65
65
|
/>
|
66
|
-
<span class="truncate"> {{
|
66
|
+
<span class="truncate"> {{ $tO(fm.title || '') }}</span>
|
67
67
|
</div>
|
68
68
|
<span v-if="fm.subtitle" class="font-light op-80">
|
69
|
-
{{
|
69
|
+
{{ $tO(fm.subtitle || '') }}
|
70
70
|
</span>
|
71
71
|
</div>
|
72
72
|
<span v-if="showSiteTitle" class="font-light truncate">
|
@@ -1,8 +1,11 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import { ref } from 'vue'
|
3
|
+
import { useI18n } from 'vue-i18n'
|
4
|
+
|
3
5
|
import { useThemeConfig } from '../../composables'
|
4
6
|
|
5
7
|
const themeConfig = useThemeConfig()
|
8
|
+
const { t } = useI18n()
|
6
9
|
|
7
10
|
const showContent = ref(false)
|
8
11
|
</script>
|
@@ -79,7 +82,7 @@ const showContent = ref(false)
|
|
79
82
|
>
|
80
83
|
<YunSiteLinkItem
|
81
84
|
:page="{
|
82
|
-
name: '
|
85
|
+
name: t('menu.posts'),
|
83
86
|
icon: 'i-ri-article-line',
|
84
87
|
url: '/posts/',
|
85
88
|
}"
|
@@ -1,11 +1,14 @@
|
|
1
1
|
<script setup lang="ts">
|
2
2
|
import type { PageProps } from '../../types'
|
3
|
+
import { useValaxyI18n } from 'valaxy'
|
3
4
|
import { useYunAppStore } from '../../stores'
|
4
5
|
|
5
6
|
defineProps<{
|
6
7
|
page: PageProps
|
7
8
|
}>()
|
8
9
|
|
10
|
+
const { $t } = useValaxyI18n()
|
11
|
+
|
9
12
|
const yunApp = useYunAppStore()
|
10
13
|
</script>
|
11
14
|
|
@@ -14,14 +17,15 @@ const yunApp = useYunAppStore()
|
|
14
17
|
class="link-item inline-flex-center gap-2 transition rounded-lg text-xl p-2 md:(text-lg p-2) lg:(text-xl p-3) text-$va-c-text"
|
15
18
|
bg="white/5 dark:black/5"
|
16
19
|
inline-flex
|
17
|
-
:to="page.url"
|
20
|
+
:to="page.url"
|
21
|
+
:title="$t(page.name)"
|
18
22
|
:style="`color:${page.color}`"
|
19
23
|
hover="bg-white/80 dark:bg-black/80"
|
20
24
|
@click="yunApp.fullscreenMenu.isOpen = false"
|
21
25
|
>
|
22
26
|
<div :class="page.icon" class="icon" />
|
23
27
|
<span>
|
24
|
-
{{ page.name }}
|
28
|
+
{{ $t(page.name) }}
|
25
29
|
</span>
|
26
30
|
</AppLink>
|
27
31
|
</template>
|
@@ -1,6 +1,7 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import { useSiteConfig } from 'valaxy'
|
2
|
+
import { useSiteConfig, useValaxyI18n } from 'valaxy'
|
3
3
|
|
4
|
+
const { $t } = useValaxyI18n()
|
4
5
|
const siteConfig = useSiteConfig()
|
5
6
|
</script>
|
6
7
|
|
@@ -9,6 +10,6 @@ const siteConfig = useSiteConfig()
|
|
9
10
|
v-if="siteConfig.subtitle"
|
10
11
|
class="site-subtitle block text-$va-c-text op-80 font-medium" text="sm"
|
11
12
|
>
|
12
|
-
{{ siteConfig.subtitle }}
|
13
|
+
{{ $t(siteConfig.subtitle) }}
|
13
14
|
</h4>
|
14
15
|
</template>
|
@@ -1,10 +1,14 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
import { useAppStore, useSiteConfig } from 'valaxy'
|
2
|
+
import { useAppStore, useSiteConfig, useValaxyI18n } from 'valaxy'
|
3
3
|
import { onMounted, ref, watch } from 'vue'
|
4
|
+
import { useI18n } from 'vue-i18n'
|
4
5
|
import { useRoute } from 'vue-router'
|
5
6
|
import { useThemeConfig } from '../../../composables'
|
6
7
|
import { useYunAppStore } from '../../../stores'
|
7
8
|
|
9
|
+
const { t } = useI18n()
|
10
|
+
const { $t } = useValaxyI18n()
|
11
|
+
|
8
12
|
// const app = useAppStore()
|
9
13
|
const yunApp = useYunAppStore()
|
10
14
|
const siteConfig = useSiteConfig()
|
@@ -60,7 +64,7 @@ const app = useAppStore()
|
|
60
64
|
<template v-if="yunApp.size.isLg">
|
61
65
|
<YunNavMenuItem
|
62
66
|
icon="i-ri-article-line" to="/posts/"
|
63
|
-
title="
|
67
|
+
:title="t('menu.posts')"
|
64
68
|
/>
|
65
69
|
|
66
70
|
<YunNavMenuItem
|
@@ -68,7 +72,7 @@ const app = useAppStore()
|
|
68
72
|
:key="i"
|
69
73
|
:icon="item.icon"
|
70
74
|
:to="item.link"
|
71
|
-
:title="item.text"
|
75
|
+
:title="$t(item.text)"
|
72
76
|
/>
|
73
77
|
</template>
|
74
78
|
</div>
|
package/layouts/post.vue
CHANGED
@@ -2,18 +2,16 @@
|
|
2
2
|
import { defineArticle, useSchemaOrg } from '@unhead/schema-org/vue'
|
3
3
|
|
4
4
|
import dayjs from 'dayjs'
|
5
|
-
import {
|
6
|
-
import { useI18n } from 'vue-i18n'
|
5
|
+
import { useFrontmatter, useSiteConfig, useValaxyI18n } from 'valaxy'
|
7
6
|
|
8
7
|
const siteConfig = useSiteConfig()
|
9
8
|
const frontmatter = useFrontmatter()
|
10
9
|
|
11
|
-
const {
|
12
|
-
const { $t } = useValaxyI18n()
|
10
|
+
const { $t, $tO } = useValaxyI18n()
|
13
11
|
const article: Parameters<typeof defineArticle>[0] = {
|
14
12
|
'@type': 'BlogPosting',
|
15
|
-
'headline':
|
16
|
-
'description':
|
13
|
+
'headline': $tO(frontmatter.value.title),
|
14
|
+
'description': $tO(frontmatter.value.description),
|
17
15
|
'author': [
|
18
16
|
{
|
19
17
|
name: $t(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.25.
|
4
|
+
"version": "0.25.1",
|
5
5
|
"author": {
|
6
6
|
"email": "me@yunyoujun.cn",
|
7
7
|
"name": "YunYouJun",
|
@@ -32,7 +32,7 @@
|
|
32
32
|
},
|
33
33
|
"devDependencies": {
|
34
34
|
"@types/animejs": "^3.1.13",
|
35
|
-
"valaxy": "0.25.
|
35
|
+
"valaxy": "0.25.1",
|
36
36
|
"valaxy-addon-waline": "0.2.1"
|
37
37
|
},
|
38
38
|
"scripts": {
|
package/styles/main.scss
CHANGED
@@ -8,9 +8,10 @@ $c-primary: #0078e7 !default;
|
|
8
8
|
);
|
9
9
|
|
10
10
|
// override the default style of star-markdown-css
|
11
|
+
@use "./animations/index.scss" as *;
|
11
12
|
@use "./common/button.scss" as *;
|
12
13
|
@use "./common/markdown.scss" as *;
|
14
|
+
// valaxy client styles
|
13
15
|
@use 'valaxy/client/styles/components/code.scss' as *;
|
14
16
|
@use 'valaxy/client/styles/components/code-group.scss' as *;
|
15
17
|
@use 'valaxy/client/styles/components/custom-block.scss' as *;
|
16
|
-
@use "./animations/index.scss" as *;
|