valaxy-theme-yun 0.16.4 → 0.17.0-beta.1
Sign up to get free protection for your applications and to get access to all the features.
- package/App.vue +1 -0
- package/components/YunPostCollapse.vue +3 -1
- package/components/YunPostMeta.vue +6 -5
- package/components/YunPostTags.vue +0 -1
- package/components/YunSidebar.vue +9 -2
- package/layouts/albums.vue +19 -12
- package/layouts/archives.vue +16 -9
- package/layouts/categories.vue +30 -23
- package/layouts/default.vue +6 -5
- package/layouts/gallery.vue +29 -22
- package/layouts/post.vue +23 -16
- package/layouts/tags.vue +40 -33
- package/package.json +2 -2
- package/pages/page/[page].vue +6 -7
- package/tsconfig.json +2 -2
- package/layouts/layout.vue +0 -42
package/App.vue
CHANGED
@@ -66,7 +66,9 @@ const sortedYears = computed(() => {
|
|
66
66
|
>
|
67
67
|
<header class="post-header" flex items-center relative>
|
68
68
|
<div class="post-meta">
|
69
|
-
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{
|
69
|
+
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{
|
70
|
+
formatDate(post.date, 'MM-DD') }}
|
71
|
+
</time>
|
70
72
|
</div>
|
71
73
|
<h2 class="post-title" inline-flex items-center font="serif black">
|
72
74
|
<RouterLink :to="post.path || ''" class="post-title-link">
|
@@ -30,14 +30,14 @@ const siteConfig = useSiteConfig()
|
|
30
30
|
flex="~ col" justify="center" items="center" text="sm" py="1"
|
31
31
|
>
|
32
32
|
<div v-if="frontmatter.date" class="post-time flex items-center">
|
33
|
-
<span class="inline-flex-center" :title="t('post.posted') + frontmatter.date">
|
33
|
+
<span class="posted-time inline-flex-center" :title="t('post.posted') + frontmatter.date">
|
34
34
|
<div class="inline-block" i-ri-calendar-line />
|
35
35
|
<time m="l-1">{{ formatDate(frontmatter.date) }}</time>
|
36
36
|
</span>
|
37
37
|
|
38
38
|
<span
|
39
39
|
v-if="frontmatter.updated && frontmatter.updated !== frontmatter.date"
|
40
|
-
class="inline-flex-center" :title="t('post.edited') + frontmatter.updated"
|
40
|
+
class="edited-time inline-flex-center" :title="t('post.edited') + frontmatter.updated"
|
41
41
|
>
|
42
42
|
<span m="x-2">-</span>
|
43
43
|
<div i-ri-calendar-2-line />
|
@@ -51,15 +51,16 @@ const siteConfig = useSiteConfig()
|
|
51
51
|
>
|
52
52
|
<span
|
53
53
|
v-if="frontmatter.wordCount"
|
54
|
-
class="inline-flex-center" :title="t('statistics.word')"
|
54
|
+
class="word-count inline-flex-center" :title="t('statistics.word')"
|
55
55
|
>
|
56
56
|
<div class="inline-block" i-ri-file-word-line />
|
57
|
-
<
|
57
|
+
<span m="l-1">{{ frontmatter.wordCount }}</span>
|
58
58
|
</span>
|
59
59
|
|
60
60
|
<span
|
61
61
|
v-if="frontmatter.readingTime"
|
62
|
-
class="inline-flex-center"
|
62
|
+
class="reading-time inline-flex-center"
|
63
|
+
:title="t('statistics.time')"
|
63
64
|
>
|
64
65
|
<span m="x-2">-</span>
|
65
66
|
<div i-ri-timer-line />
|
@@ -1,6 +1,6 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
|
-
import { ref } from 'vue'
|
3
|
-
import { useAppStore } from 'valaxy'
|
2
|
+
import { ref, watch } from 'vue'
|
3
|
+
import { useAppStore, useLayout } from 'valaxy'
|
4
4
|
|
5
5
|
defineProps<{
|
6
6
|
showHamburger?: boolean
|
@@ -8,6 +8,13 @@ defineProps<{
|
|
8
8
|
|
9
9
|
const app = useAppStore()
|
10
10
|
const showOverview = ref(false)
|
11
|
+
|
12
|
+
const isHome = useLayout('home')
|
13
|
+
watch(isHome, () => {
|
14
|
+
app.isSidebarOpen = !isHome.value
|
15
|
+
}, {
|
16
|
+
immediate: true,
|
17
|
+
})
|
11
18
|
</script>
|
12
19
|
|
13
20
|
<template>
|
package/layouts/albums.vue
CHANGED
@@ -20,16 +20,23 @@ const albums = computed(() => frontmatter.value.albums || [])
|
|
20
20
|
</script>
|
21
21
|
|
22
22
|
<template>
|
23
|
-
<
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
23
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
24
|
+
<slot name="sidebar-child" />
|
25
|
+
</YunSidebar>
|
26
|
+
<YunSidebar v-else />
|
27
|
+
|
28
|
+
<RouterView v-slot="{ Component }">
|
29
|
+
<component :is="Component">
|
30
|
+
<template #main-header>
|
31
|
+
<YunPageHeader :title="title || t('title.album')" :icon="frontmatter.icon || 'i-ri-gallery-line'" :color="frontmatter.color" />
|
32
|
+
</template>
|
33
|
+
<template #main-content>
|
34
|
+
<div text="center" class="yun-text-light" p="2">
|
35
|
+
{{ t('counter.albums', albums.length) }}
|
36
|
+
</div>
|
37
|
+
<YunAlbumList :albums="albums" />
|
38
|
+
<RouterView />
|
39
|
+
</template>
|
40
|
+
</component>
|
41
|
+
</RouterView>
|
35
42
|
</template>
|
package/layouts/archives.vue
CHANGED
@@ -18,13 +18,20 @@ useSchemaOrg([
|
|
18
18
|
</script>
|
19
19
|
|
20
20
|
<template>
|
21
|
-
<
|
22
|
-
<
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
21
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
22
|
+
<slot name="sidebar-child" />
|
23
|
+
</YunSidebar>
|
24
|
+
<YunSidebar v-else />
|
25
|
+
|
26
|
+
<RouterView v-slot="{ Component }">
|
27
|
+
<component :is="Component">
|
28
|
+
<template #main-header>
|
29
|
+
<YunPageHeader :title="title || t('menu.archives')" :icon="frontmatter.icon || 'i-ri-archive-line'" :color="frontmatter.color" />
|
30
|
+
</template>
|
31
|
+
<template #main-content>
|
32
|
+
<RouterView />
|
33
|
+
<YunPostCollapse :posts="site.postList" />
|
34
|
+
</template>
|
35
|
+
</component>
|
36
|
+
</RouterView>
|
30
37
|
</template>
|
package/layouts/categories.vue
CHANGED
@@ -39,30 +39,37 @@ useSchemaOrg([
|
|
39
39
|
</script>
|
40
40
|
|
41
41
|
<template>
|
42
|
-
<
|
43
|
-
<
|
44
|
-
|
45
|
-
|
46
|
-
:icon="frontmatter.icon || 'i-ri-folder-2-line'"
|
47
|
-
:color="frontmatter.color"
|
48
|
-
/>
|
49
|
-
</template>
|
50
|
-
<template #main-content>
|
51
|
-
<div text="center" class="yun-text-light" p="2">
|
52
|
-
{{ t('counter.categories', categories.children.length) }}
|
53
|
-
</div>
|
54
|
-
<YunCategories :categories="categories.children" />
|
55
|
-
<RouterView />
|
56
|
-
</template>
|
42
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
43
|
+
<slot name="sidebar-child" />
|
44
|
+
</YunSidebar>
|
45
|
+
<YunSidebar v-else />
|
57
46
|
|
58
|
-
|
59
|
-
|
47
|
+
<RouterView v-slot="{ Component }">
|
48
|
+
<component :is="Component">
|
49
|
+
<template #main-header>
|
60
50
|
<YunPageHeader
|
61
|
-
:title="
|
62
|
-
icon="i-ri-folder-
|
51
|
+
:title="title || t('menu.categories')"
|
52
|
+
:icon="frontmatter.icon || 'i-ri-folder-2-line'"
|
53
|
+
:color="frontmatter.color"
|
63
54
|
/>
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
55
|
+
</template>
|
56
|
+
<template #main-content>
|
57
|
+
<div text="center" class="yun-text-light" p="2">
|
58
|
+
{{ t('counter.categories', categories.children.length) }}
|
59
|
+
</div>
|
60
|
+
<YunCategories :categories="categories.children" />
|
61
|
+
<RouterView />
|
62
|
+
</template>
|
63
|
+
|
64
|
+
<template #main-nav-before>
|
65
|
+
<YunCard v-if="curCategory" class="post-collapse-container" m="t-4" w="full">
|
66
|
+
<YunPageHeader
|
67
|
+
:title="curCategory === 'Uncategorized' ? t('category.uncategorized') : curCategory.split('/').join(' / ')"
|
68
|
+
icon="i-ri-folder-open-line"
|
69
|
+
/>
|
70
|
+
<YunPostCollapse w="full" m="b-4" p="x-20 lt-sm:x-5" :posts="posts" />
|
71
|
+
</YunCard>
|
72
|
+
</template>
|
73
|
+
</component>
|
74
|
+
</RouterView>
|
68
75
|
</template>
|
package/layouts/default.vue
CHANGED
package/layouts/gallery.vue
CHANGED
@@ -29,26 +29,33 @@ const YunGallery = runtimeConfig.value.addons['valaxy-addon-lightgallery']
|
|
29
29
|
</script>
|
30
30
|
|
31
31
|
<template>
|
32
|
-
<
|
33
|
-
<
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
32
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
33
|
+
<slot name="sidebar-child" />
|
34
|
+
</YunSidebar>
|
35
|
+
<YunSidebar v-else />
|
36
|
+
|
37
|
+
<RouterView v-slot="{ Component }">
|
38
|
+
<component :is="Component">
|
39
|
+
<template #main-header>
|
40
|
+
<YunPageHeader
|
41
|
+
:title="title || t('title.gallery')"
|
42
|
+
:icon="frontmatter.icon || 'i-ri-gallery-line'"
|
43
|
+
:color="frontmatter.color"
|
44
|
+
/>
|
45
|
+
</template>
|
46
|
+
<template #main-content>
|
47
|
+
<div text="center" class="yun-text-light" p="2">
|
48
|
+
{{ t('counter.photos', photos.length) }}
|
49
|
+
</div>
|
50
|
+
<div class="page-action" text="center">
|
51
|
+
<a class="yun-icon-btn" :title="t('accessibility.back')" @click="() => router.back()">
|
52
|
+
<div i-ri-arrow-go-back-line />
|
53
|
+
</a>
|
54
|
+
</div>
|
55
|
+
<ValaxyGalleryDecrypt v-if="frontmatter.encryptedPhotos" :encrypted-photos="frontmatter.encryptedPhotos" />
|
56
|
+
<YunGallery v-else :photos="photos" />
|
57
|
+
<RouterView />
|
58
|
+
</template>
|
59
|
+
</component>
|
60
|
+
</RouterView>
|
54
61
|
</template>
|
package/layouts/post.vue
CHANGED
@@ -41,20 +41,27 @@ useSchemaOrg(
|
|
41
41
|
</script>
|
42
42
|
|
43
43
|
<template>
|
44
|
-
<
|
45
|
-
<
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
<
|
58
|
-
|
59
|
-
|
44
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
45
|
+
<slot name="sidebar-child" />
|
46
|
+
</YunSidebar>
|
47
|
+
<YunSidebar v-else />
|
48
|
+
|
49
|
+
<RouterView v-slot="{ Component }">
|
50
|
+
<component :is="Component">
|
51
|
+
<template #main-header-after>
|
52
|
+
<YunPostMeta :frontmatter="frontmatter" />
|
53
|
+
<YunWalineMeta />
|
54
|
+
<YunPostCategoriesAndTags :frontmatter="frontmatter" />
|
55
|
+
</template>
|
56
|
+
|
57
|
+
<template #main-content-after>
|
58
|
+
<YunSponsor v-if="showSponsor" m="t-6" />
|
59
|
+
<ValaxyCopyright v-if="frontmatter.copyright || siteConfig.license.enabled" :url="url" m="y-4" />
|
60
|
+
</template>
|
61
|
+
|
62
|
+
<template #aside-custom>
|
63
|
+
<slot name="aside-custom" />
|
64
|
+
</template>
|
65
|
+
</component>
|
66
|
+
</RouterView>
|
60
67
|
</template>
|
package/layouts/tags.vue
CHANGED
@@ -58,38 +58,45 @@ const title = usePostTitle(frontmatter)
|
|
58
58
|
</script>
|
59
59
|
|
60
60
|
<template>
|
61
|
-
<
|
62
|
-
<
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
<div class="justify-center items-end" flex="~ wrap" gap="1">
|
75
|
-
<YunLayoutPostTag
|
76
|
-
v-for="[key, tag] in Array.from(tags).sort()"
|
77
|
-
:key="key"
|
78
|
-
:title="key"
|
79
|
-
:count="tag.count"
|
80
|
-
:style="getTagStyle(tag.count)"
|
81
|
-
@click="displayTag(key.toString())"
|
61
|
+
<YunSidebar v-if="$slots['sidebar-child']">
|
62
|
+
<slot name="sidebar-child" />
|
63
|
+
</YunSidebar>
|
64
|
+
<YunSidebar v-else />
|
65
|
+
|
66
|
+
<RouterView v-slot="{ Component }">
|
67
|
+
<component :is="Component">
|
68
|
+
<template #main-header>
|
69
|
+
<YunPageHeader
|
70
|
+
:title="title || t('menu.tags')"
|
71
|
+
:icon="frontmatter.icon || 'i-ri-tag-line'"
|
72
|
+
:color="frontmatter.color"
|
82
73
|
/>
|
83
|
-
</
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
74
|
+
</template>
|
75
|
+
<template #main-content>
|
76
|
+
<div class="yun-text-light" text="center" p="2">
|
77
|
+
{{ t('counter.tags', Array.from(tags).length) }}
|
78
|
+
</div>
|
79
|
+
|
80
|
+
<div class="justify-center items-end" flex="~ wrap" gap="1">
|
81
|
+
<YunLayoutPostTag
|
82
|
+
v-for="[key, tag] in Array.from(tags).sort()"
|
83
|
+
:key="key"
|
84
|
+
:title="key"
|
85
|
+
:count="tag.count"
|
86
|
+
:style="getTagStyle(tag.count)"
|
87
|
+
@click="displayTag(key.toString())"
|
88
|
+
/>
|
89
|
+
</div>
|
90
|
+
|
91
|
+
<RouterView />
|
92
|
+
</template>
|
93
|
+
|
94
|
+
<template #main-nav-before>
|
95
|
+
<YunCard v-if="curTag" ref="collapse" m="t-4" w="full">
|
96
|
+
<YunPageHeader :title="curTag" icon="i-ri-hashtag" />
|
97
|
+
<YunPostCollapse w="full" m="b-4" p="x-20 lt-sm:x-5" :posts="posts" />
|
98
|
+
</YunCard>
|
99
|
+
</template>
|
100
|
+
</component>
|
101
|
+
</RouterView>
|
95
102
|
</template>
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.
|
3
|
+
"version": "0.17.0-beta.1",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -24,7 +24,7 @@
|
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"@types/animejs": "^3.1.12",
|
27
|
-
"valaxy": "0.
|
27
|
+
"valaxy": "0.17.0-beta.1",
|
28
28
|
"valaxy-addon-waline": "0.1.1"
|
29
29
|
}
|
30
30
|
}
|
package/pages/page/[page].vue
CHANGED
@@ -1,12 +1,11 @@
|
|
1
1
|
<script setup lang="ts">
|
2
|
-
|
2
|
+
import { useRoute } from 'vue-router'
|
3
|
+
import { computed } from 'vue'
|
4
|
+
|
5
|
+
const route = useRoute()
|
6
|
+
const pageIndex = computed(() => Number.parseInt((route.params as { page: string }).page))
|
3
7
|
</script>
|
4
8
|
|
5
9
|
<template>
|
6
|
-
<YunPostList :cur-page="
|
10
|
+
<YunPostList :cur-page="pageIndex" />
|
7
11
|
</template>
|
8
|
-
|
9
|
-
<route lang="yaml">
|
10
|
-
meta:
|
11
|
-
layout: home
|
12
|
-
</route>
|
package/tsconfig.json
CHANGED
package/layouts/layout.vue
DELETED
@@ -1,42 +0,0 @@
|
|
1
|
-
<script lang="ts" setup>
|
2
|
-
import { asAny } from 'valaxy'
|
3
|
-
</script>
|
4
|
-
|
5
|
-
<template>
|
6
|
-
<YunSidebar v-if="$slots['sidebar-child']">
|
7
|
-
<slot name="sidebar-child" />
|
8
|
-
</YunSidebar>
|
9
|
-
<YunSidebar v-else />
|
10
|
-
|
11
|
-
<RouterView v-slot="{ Component }">
|
12
|
-
<component :is="asAny(Component)">
|
13
|
-
<template #main-header>
|
14
|
-
<slot name="main-header" />
|
15
|
-
</template>
|
16
|
-
|
17
|
-
<template #main-header-after>
|
18
|
-
<slot name="main-header-after" />
|
19
|
-
</template>
|
20
|
-
<template #main>
|
21
|
-
<slot name="main" />
|
22
|
-
</template>
|
23
|
-
<template #main-content>
|
24
|
-
<slot name="main-content" />
|
25
|
-
</template>
|
26
|
-
<template #main-content-after>
|
27
|
-
<slot name="main-content-after" />
|
28
|
-
</template>
|
29
|
-
<template #main-nav-before>
|
30
|
-
<slot name="main-nav-before" />
|
31
|
-
</template>
|
32
|
-
<template #main-nav-after>
|
33
|
-
<slot name="main-nav-after" />
|
34
|
-
</template>
|
35
|
-
<template #aside-custom>
|
36
|
-
<slot name="aside-custom" />
|
37
|
-
</template>
|
38
|
-
</component>
|
39
|
-
</RouterView>
|
40
|
-
|
41
|
-
<YunBackToTop />
|
42
|
-
</template>
|