valaxy-theme-yun 1.0.0 → 1.1.0
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/ValaxyMain.vue +4 -1
- package/components/YunCard.vue +2 -2
- package/components/YunCover.vue +11 -11
- package/components/YunPostCard.vue +13 -6
- package/node/config.ts +2 -1
- package/package.json +2 -2
|
@@ -48,7 +48,10 @@ onContentUpdated(() => {
|
|
|
48
48
|
flex="~ col grow"
|
|
49
49
|
p="lt-md:0"
|
|
50
50
|
>
|
|
51
|
-
<YunCard
|
|
51
|
+
<YunCard
|
|
52
|
+
:cover="frontmatter.cover" :cover-component="frontmatter.coverComponent" :cover-props="frontmatter.coverProps"
|
|
53
|
+
m="0" v-bind="styles ? { style: styles } : {}"
|
|
54
|
+
>
|
|
52
55
|
<YunPostActions />
|
|
53
56
|
<div class="mt-8 mb-4">
|
|
54
57
|
<slot name="main-header">
|
package/components/YunCard.vue
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script lang="ts" setup>
|
|
2
|
-
defineProps<{ cover?: string }>()
|
|
2
|
+
defineProps<{ cover?: string, coverComponent?: string, coverProps?: Record<string, unknown> }>()
|
|
3
3
|
</script>
|
|
4
4
|
|
|
5
5
|
<template>
|
|
@@ -8,7 +8,7 @@ defineProps<{ cover?: string }>()
|
|
|
8
8
|
min-h="100px"
|
|
9
9
|
bg="$va-c-bg-light"
|
|
10
10
|
>
|
|
11
|
-
<YunCover :src="cover" />
|
|
11
|
+
<YunCover :src="cover" :component="coverComponent" :component-props="coverProps" />
|
|
12
12
|
|
|
13
13
|
<div v-if="$slots.header" class="yun-card-header">
|
|
14
14
|
<header>
|
package/components/YunCover.vue
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
<script lang="ts"
|
|
2
|
-
defineProps<{
|
|
1
|
+
<script setup lang="ts">
|
|
2
|
+
withDefaults(defineProps<{
|
|
3
3
|
src?: string
|
|
4
|
-
|
|
4
|
+
component?: string
|
|
5
|
+
componentProps?: Record<string, unknown>
|
|
6
|
+
alt?: string
|
|
7
|
+
context?: 'card' | 'page'
|
|
8
|
+
}>(), { context: 'page' })
|
|
5
9
|
</script>
|
|
6
10
|
|
|
7
11
|
<template>
|
|
8
|
-
<
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:src="src"
|
|
13
|
-
loading="lazy"
|
|
14
|
-
alt=""
|
|
15
|
-
>
|
|
12
|
+
<ValaxyCover
|
|
13
|
+
class="yun-cover" :class="context === 'page' && 'h-64 md:h-sm'"
|
|
14
|
+
:src="src" :component="component" :component-props="componentProps" :alt="alt" :context="context"
|
|
15
|
+
/>
|
|
16
16
|
</template>
|
|
@@ -12,6 +12,7 @@ const props = defineProps<{
|
|
|
12
12
|
const themeConfig = useThemeConfig()
|
|
13
13
|
const { t } = useI18n()
|
|
14
14
|
const { $tO } = useValaxyI18n()
|
|
15
|
+
const hasCover = computed(() => Boolean(props.post.cover || props.post.coverComponent))
|
|
15
16
|
|
|
16
17
|
const { icon, styles, color } = usePostProperty(props.post.type)
|
|
17
18
|
|
|
@@ -31,19 +32,20 @@ const postTitleClass = computed(() => {
|
|
|
31
32
|
<YunCard
|
|
32
33
|
class="post-card-wrapper w-full hover:scale-102 hover:z-1"
|
|
33
34
|
mx="4"
|
|
34
|
-
:class="
|
|
35
|
+
:class="hasCover ? 'post-card-image' : 'post-card'"
|
|
35
36
|
overflow="hidden" v-bind="styles ? { style: styles } : {}"
|
|
36
37
|
>
|
|
37
38
|
<!-- Overlay link covers the entire card -->
|
|
38
39
|
<AppLink class="post-card-overlay" :to="post.path || ''" :aria-label="$tO(post.title)" tabindex="0" />
|
|
39
40
|
|
|
40
41
|
<div class="flex flex-1 of-hidden justify-start items-start post-card-info" w="full">
|
|
41
|
-
<
|
|
42
|
-
v-if="
|
|
43
|
-
|
|
44
|
-
|
|
42
|
+
<YunCover
|
|
43
|
+
v-if="hasCover" :src="post.cover" :alt="t('post.cover')"
|
|
44
|
+
:component="post.coverComponent" :component-props="post.coverProps" context="card"
|
|
45
|
+
class="post-card-cover cover md:shadow"
|
|
46
|
+
/>
|
|
45
47
|
|
|
46
|
-
<div class="post-card-body flex flex-col items-center relative" :class="
|
|
48
|
+
<div class="post-card-body flex flex-col items-center relative" :class="hasCover && 'post-card-body-with-cover'" w="full">
|
|
47
49
|
<AppLink class="post-title-link" :to="post.path || ''" m="t-3" :class="postTitleClass" tabindex="-1">
|
|
48
50
|
<div class="post-card-title flex-center title text-2xl" text="center" font="serif black">
|
|
49
51
|
<div v-if="post.type" class="inline-flex" m="r-1" :class="icon" />
|
|
@@ -130,6 +132,11 @@ const postTitleClass = computed(() => {
|
|
|
130
132
|
}
|
|
131
133
|
}
|
|
132
134
|
|
|
135
|
+
// Component covers own their interactions; the rest of the card remains a link.
|
|
136
|
+
.post-card-cover .valaxy-cover-content {
|
|
137
|
+
z-index: 2;
|
|
138
|
+
}
|
|
139
|
+
|
|
133
140
|
// Interactive elements float above the overlay while empty action-bar space
|
|
134
141
|
// remains part of the card's main click target.
|
|
135
142
|
.post-title-link,
|
package/node/config.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ThemeConfig, UserThemeConfig } from '../types'
|
|
2
|
+
import { $t } from 'valaxy'
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Default Config
|
|
@@ -61,7 +62,7 @@ export const defaultThemeConfig: ThemeConfig = {
|
|
|
61
62
|
},
|
|
62
63
|
|
|
63
64
|
nav: [
|
|
64
|
-
{ text: 'menu.posts', link: '/posts/', icon: 'i-ri-article-line' },
|
|
65
|
+
{ text: $t('menu.posts'), link: '/posts/', icon: 'i-ri-article-line' },
|
|
65
66
|
],
|
|
66
67
|
pages: [],
|
|
67
68
|
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "valaxy-theme-yun",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.1.0",
|
|
5
5
|
"description": "Default theme (Yun) for Valaxy — a Vite & Vue powered static blog generator",
|
|
6
6
|
"author": {
|
|
7
7
|
"email": "me@yunyoujun.cn",
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
"valaxy-addon-girls": "0.1.0"
|
|
42
42
|
},
|
|
43
43
|
"devDependencies": {
|
|
44
|
-
"valaxy": "1.
|
|
44
|
+
"valaxy": "1.1.0",
|
|
45
45
|
"valaxy-addon-waline": "0.2.1"
|
|
46
46
|
},
|
|
47
47
|
"scripts": {
|