valaxy-theme-yun 0.15.10 → 0.15.12
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 +2 -5
- package/components/YunCategory.vue +2 -2
- package/components/YunConfig.vue +2 -2
- package/components/YunFuseSearch.vue +2 -2
- package/components/YunMdTimeWarning.vue +10 -12
- package/components/YunOverview.vue +6 -6
- package/components/YunPostCategories.vue +2 -2
- package/components/YunPostCollapse.vue +2 -2
- package/components/YunPostNav.vue +4 -4
- package/components/YunPostTags.vue +2 -2
- package/components/YunSidebarNav.vue +8 -8
- package/components/third/YunWaline.vue +5 -1
- package/docs/zh-CN/README.md +1 -1
- package/layouts/404.vue +1 -2
- package/layouts/albums.vue +1 -1
- package/layouts/archives.vue +1 -1
- package/layouts/categories.vue +1 -1
- package/layouts/default.vue +1 -1
- package/layouts/gallery.vue +1 -1
- package/layouts/home.vue +1 -1
- package/layouts/layout.vue +2 -2
- package/layouts/tags.vue +1 -1
- package/package.json +3 -3
- package/styles/index.scss +2 -1
@@ -56,11 +56,8 @@ onContentUpdated(() => {
|
|
56
56
|
e.preventDefault()
|
57
57
|
// scroll between hash anchors in the same page
|
58
58
|
if (hash && hash !== currentUrl.hash) {
|
59
|
-
await router.push({ hash })
|
60
|
-
history.replaceState({ ...history.state }, '')
|
59
|
+
await router.push({ hash: decodeURIComponent(hash) })
|
61
60
|
|
62
|
-
// still emit the event so we can listen to it in themes
|
63
|
-
window.dispatchEvent(new Event('hashchange'))
|
64
61
|
// use smooth scroll when clicking on header anchor links
|
65
62
|
scrollTo(link, hash, link.classList.contains('header-anchor'))
|
66
63
|
}
|
@@ -94,7 +91,7 @@ onContentUpdated(() => {
|
|
94
91
|
<Transition appear>
|
95
92
|
<ValaxyMd :frontmatter="frontmatter">
|
96
93
|
<YunAiExcerpt v-if="frontmatter.excerpt_type === 'ai' && frontmatter.excerpt" />
|
97
|
-
<YunMdTimeWarning
|
94
|
+
<YunMdTimeWarning />
|
98
95
|
|
99
96
|
<slot name="main-content-md" />
|
100
97
|
<slot />
|
@@ -84,10 +84,10 @@ onMounted(() => {
|
|
84
84
|
</template>
|
85
85
|
|
86
86
|
<template v-else>
|
87
|
-
<
|
87
|
+
<RouterLink v-if="categoryItem.title" :to="categoryItem.path || ''" class="inline-flex items-center">
|
88
88
|
<div i-ri-file-text-line />
|
89
89
|
<span m="l-1" font="serif black">{{ getTitle(categoryItem) }}</span>
|
90
|
-
</
|
90
|
+
</RouterLink>
|
91
91
|
</template>
|
92
92
|
</li>
|
93
93
|
</ul>
|
package/components/YunConfig.vue
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { useI18n } from 'vue-i18n'
|
3
3
|
import { computed } from 'vue'
|
4
|
-
import { isDark,
|
4
|
+
import { isDark, toggleDarkWithTransition } from 'valaxy'
|
5
5
|
|
6
6
|
const { t } = useI18n()
|
7
7
|
|
@@ -12,7 +12,7 @@ const themeTitle = computed(() => {
|
|
12
12
|
|
13
13
|
<template>
|
14
14
|
<div>
|
15
|
-
<button class="yun-icon-btn" :title="themeTitle" :style="{ color: isDark ? '' : '#f1cb64' }" @click="
|
15
|
+
<button class="yun-icon-btn" :title="themeTitle" :style="{ color: isDark ? '' : '#f1cb64' }" @click="toggleDarkWithTransition">
|
16
16
|
<div i="ri-sun-line dark:ri-moon-line" />
|
17
17
|
</button>
|
18
18
|
|
@@ -78,7 +78,7 @@ onClickOutside(searchInputRef, () => {
|
|
78
78
|
</script>
|
79
79
|
|
80
80
|
<template>
|
81
|
-
<
|
81
|
+
<Transition
|
82
82
|
name="fade"
|
83
83
|
@enter="lockBodyScroll"
|
84
84
|
@after-leave="unlockBodyScroll"
|
@@ -117,7 +117,7 @@ onClickOutside(searchInputRef, () => {
|
|
117
117
|
</div>
|
118
118
|
</div>
|
119
119
|
</div>
|
120
|
-
</
|
120
|
+
</Transition>
|
121
121
|
</template>
|
122
122
|
|
123
123
|
<style lang="scss">
|
@@ -1,35 +1,33 @@
|
|
1
1
|
<script lang="ts" setup>
|
2
2
|
import { computed } from 'vue'
|
3
|
-
import
|
3
|
+
import { useFrontmatter } from 'valaxy'
|
4
4
|
|
5
5
|
import dayjs from 'dayjs'
|
6
6
|
import relativeTime from 'dayjs/plugin/relativeTime'
|
7
7
|
|
8
8
|
import { useI18n } from 'vue-i18n'
|
9
9
|
|
10
|
-
const
|
11
|
-
frontmatter: Post
|
12
|
-
}>()
|
10
|
+
const fm = useFrontmatter()
|
13
11
|
|
14
12
|
dayjs.extend(relativeTime)
|
15
13
|
|
16
14
|
const { t } = useI18n()
|
17
15
|
|
18
16
|
/**
|
19
|
-
* when the post is updated more than
|
20
|
-
* default
|
17
|
+
* when the post is updated more than 180 days ago, show a warning
|
18
|
+
* default 180 days, you can set `time_warning` in frontmatter to change it
|
21
19
|
*/
|
22
20
|
const time_warning = computed(() => {
|
23
|
-
const diff = dayjs().valueOf() - dayjs(
|
24
|
-
if (typeof
|
25
|
-
return diff >
|
21
|
+
const diff = dayjs().valueOf() - dayjs(fm.value.updated || fm.value.date).valueOf()
|
22
|
+
if (typeof fm.value.time_warning === 'number')
|
23
|
+
return diff > fm.value.time_warning
|
26
24
|
else
|
27
|
-
return
|
25
|
+
return fm.value.time_warning
|
28
26
|
})
|
29
27
|
</script>
|
30
28
|
|
31
29
|
<template>
|
32
|
-
<blockquote v-if="time_warning" op="80">
|
33
|
-
{{ t('post.time_warning', { ago: dayjs(
|
30
|
+
<blockquote v-if="time_warning" class="yun-time-warning" op="80">
|
31
|
+
{{ t('post.time_warning', { ago: dayjs(fm.updated).fromNow() }) }}
|
34
32
|
</blockquote>
|
35
33
|
</template>
|
@@ -9,21 +9,21 @@ const router = useRouter()
|
|
9
9
|
<template>
|
10
10
|
<div class="sidebar-panel" p="2">
|
11
11
|
<div class="site-info" m="t-6">
|
12
|
-
<
|
12
|
+
<RouterLink class="site-author-avatar" to="/about">
|
13
13
|
<img class="rounded-full" :src="siteConfig.author.avatar" alt="avatar">
|
14
14
|
<span class="site-author-status" :title="siteConfig.author.status.message">{{ siteConfig.author.status.emoji }}</span>
|
15
|
-
</
|
15
|
+
</RouterLink>
|
16
16
|
<div
|
17
17
|
class="site-author-name leading-6"
|
18
18
|
m="t-0 b-4"
|
19
19
|
>
|
20
|
-
<
|
20
|
+
<RouterLink to="/about">
|
21
21
|
{{ siteConfig.author.name }}
|
22
|
-
</
|
22
|
+
</RouterLink>
|
23
23
|
</div>
|
24
|
-
<
|
24
|
+
<RouterLink v-if="router.hasRoute('about-site')" to="/about/site" class="site-name">
|
25
25
|
{{ siteConfig.title }}
|
26
|
-
</
|
26
|
+
</RouterLink>
|
27
27
|
<span v-else class="site-name">{{ siteConfig.title }}</span>
|
28
28
|
<h4 v-if="siteConfig.subtitle" class="site-subtitle block" text="xs">
|
29
29
|
{{ siteConfig.subtitle }}
|
@@ -7,7 +7,7 @@ defineProps<{
|
|
7
7
|
</script>
|
8
8
|
|
9
9
|
<template>
|
10
|
-
<
|
10
|
+
<RouterLink
|
11
11
|
:to="{
|
12
12
|
path: '/categories',
|
13
13
|
query: { category: Array.isArray(categories) ? categories.join('/') : categories },
|
@@ -21,5 +21,5 @@ defineProps<{
|
|
21
21
|
<span>
|
22
22
|
{{ Array.isArray(categories) ? categories.join(' > ') : categories }}
|
23
23
|
</span>
|
24
|
-
</
|
24
|
+
</RouterLink>
|
25
25
|
</template>
|
@@ -69,9 +69,9 @@ const sortedYears = computed(() => {
|
|
69
69
|
<time v-if="post.date" class="post-time" font="mono" opacity="80">{{ formatDate(post.date, 'MM-DD') }}</time>
|
70
70
|
</div>
|
71
71
|
<h2 class="post-title" inline-flex items-center font="serif black">
|
72
|
-
<
|
72
|
+
<RouterLink :to="post.path || ''" class="post-title-link">
|
73
73
|
{{ post.title }}
|
74
|
-
</
|
74
|
+
</RouterLink>
|
75
75
|
</h2>
|
76
76
|
</header>
|
77
77
|
</article>
|
@@ -7,16 +7,16 @@ const [prev, next] = usePrevNext()
|
|
7
7
|
<template>
|
8
8
|
<div class="post-nav">
|
9
9
|
<div class="post-nav-item">
|
10
|
-
<
|
10
|
+
<RouterLink v-if="prev" class="post-nav-prev" :to="prev.path || ''" :title="prev.title">
|
11
11
|
<div class="icon" i-ri-arrow-left-s-line />
|
12
12
|
<span class="title truncate" text="sm">{{ prev.title }}</span>
|
13
|
-
</
|
13
|
+
</RouterLink>
|
14
14
|
</div>
|
15
15
|
<div class="post-nav-item">
|
16
|
-
<
|
16
|
+
<RouterLink v-if="next" :to="next.path || ''" :title="next.title" class="post-nav-next">
|
17
17
|
<span class="title truncate" text="sm">{{ next.title }}</span>
|
18
18
|
<div class="icon" i-ri-arrow-right-s-line />
|
19
|
-
</
|
19
|
+
</RouterLink>
|
20
20
|
</div>
|
21
21
|
</div>
|
22
22
|
</template>
|
@@ -11,7 +11,7 @@ defineProps<{
|
|
11
11
|
class="post-tags inline-flex" items="center" gap="1"
|
12
12
|
flex="wrap 1" justify="end"
|
13
13
|
>
|
14
|
-
<
|
14
|
+
<RouterLink
|
15
15
|
v-for="tag, i in tags" :key="i" :to="{ path: '/tags/', query: { tag } }"
|
16
16
|
class="transition post-tag inline-flex-center text-xs border-$va-c-divider hover:(text-blue-500 border-blue-500)"
|
17
17
|
px-2 h="7"
|
@@ -21,6 +21,6 @@ defineProps<{
|
|
21
21
|
>
|
22
22
|
<!-- <div m="r-1" i-ri-price-tag-3-line /> -->
|
23
23
|
<span>{{ tag }}</span>
|
24
|
-
</
|
24
|
+
</RouterLink>
|
25
25
|
</div>
|
26
26
|
</template>
|
@@ -14,22 +14,22 @@ const tags = useTags()
|
|
14
14
|
|
15
15
|
<template>
|
16
16
|
<nav class="site-nav" text-xl mt-6>
|
17
|
-
<
|
17
|
+
<RouterLink class="site-link-item yun-icon-btn" to="/" :title="t('menu.home')">
|
18
18
|
<div i-ri-home-4-line />
|
19
|
-
</
|
19
|
+
</RouterLink>
|
20
20
|
|
21
|
-
<
|
21
|
+
<RouterLink class="site-link-item" to="/archives/" :title="t('menu.archives')">
|
22
22
|
<div class="icon" i-ri-archive-line />
|
23
23
|
<span class="count">{{ site.postList.length }}</span>
|
24
|
-
</
|
25
|
-
<
|
24
|
+
</RouterLink>
|
25
|
+
<RouterLink class="site-link-item" to="/categories/" :title="t('menu.categories')">
|
26
26
|
<div class="icon" i-ri-folder-2-line />
|
27
27
|
<span class="count">{{ Array.from(categories.children).length }}</span>
|
28
|
-
</
|
29
|
-
<
|
28
|
+
</RouterLink>
|
29
|
+
<RouterLink class="site-link-item" to="/tags/" :title="t('menu.tags')">
|
30
30
|
<div class="icon" i-ri-price-tag-3-line />
|
31
31
|
<span class="count">{{ Array.from(tags).length }}</span>
|
32
|
-
</
|
32
|
+
</RouterLink>
|
33
33
|
|
34
34
|
<AppLink class="site-link-item yun-icon-btn" :to="themeConfig.menu.custom.url" :title="t(themeConfig.menu.custom.title)">
|
35
35
|
<div :class="themeConfig.menu.custom.icon" />
|
package/docs/zh-CN/README.md
CHANGED
package/layouts/404.vue
CHANGED
@@ -14,7 +14,7 @@ const { back } = useBack()
|
|
14
14
|
404
|
15
15
|
</div>
|
16
16
|
|
17
|
-
<
|
17
|
+
<RouterView />
|
18
18
|
|
19
19
|
<div>
|
20
20
|
<button class="btn rounded-full" p="x-6 y-2" text="sm" m="3 t8" :title="t('button.back')" @click="back">
|
@@ -25,7 +25,6 @@ const { back } = useBack()
|
|
25
25
|
</template>
|
26
26
|
|
27
27
|
<style lang="scss" scoped>
|
28
|
-
// inspired by https://codepen.io/pgalor/pen/OeRWJQ
|
29
28
|
.not-found {
|
30
29
|
font-size: 10rem;
|
31
30
|
text-shadow: 0 5px 10px rgba(0,0,0,.25), 0 20px 20px rgba(0,0,0,.15);
|
package/layouts/albums.vue
CHANGED
package/layouts/archives.vue
CHANGED
@@ -23,7 +23,7 @@ useSchemaOrg([
|
|
23
23
|
<YunPageHeader :title="title || t('menu.archives')" :icon="frontmatter.icon || 'i-ri-archive-line'" :color="frontmatter.color" />
|
24
24
|
</template>
|
25
25
|
<template #main-content>
|
26
|
-
<
|
26
|
+
<RouterView />
|
27
27
|
<YunPostCollapse :posts="site.postList" />
|
28
28
|
</template>
|
29
29
|
</Layout>
|
package/layouts/categories.vue
CHANGED
package/layouts/default.vue
CHANGED
package/layouts/gallery.vue
CHANGED
@@ -48,7 +48,7 @@ const YunGallery = runtimeConfig.value.addons['valaxy-addon-lightgallery']
|
|
48
48
|
</div>
|
49
49
|
<ValaxyGalleryDecrypt v-if="frontmatter.encryptedPhotos" :encrypted-photos="frontmatter.encryptedPhotos" />
|
50
50
|
<YunGallery v-else :photos="photos" />
|
51
|
-
<
|
51
|
+
<RouterView />
|
52
52
|
</template>
|
53
53
|
</Layout>
|
54
54
|
</template>
|
package/layouts/home.vue
CHANGED
package/layouts/layout.vue
CHANGED
@@ -8,7 +8,7 @@ import { asAny } from 'valaxy'
|
|
8
8
|
</YunSidebar>
|
9
9
|
<YunSidebar v-else />
|
10
10
|
|
11
|
-
<
|
11
|
+
<RouterView v-slot="{ Component }">
|
12
12
|
<component :is="asAny(Component)">
|
13
13
|
<template #main-header>
|
14
14
|
<slot name="main-header" />
|
@@ -36,7 +36,7 @@ import { asAny } from 'valaxy'
|
|
36
36
|
<slot name="aside-custom" />
|
37
37
|
</template>
|
38
38
|
</component>
|
39
|
-
</
|
39
|
+
</RouterView>
|
40
40
|
|
41
41
|
<YunBackToTop />
|
42
42
|
</template>
|
package/layouts/tags.vue
CHANGED
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "valaxy-theme-yun",
|
3
|
-
"version": "0.15.
|
3
|
+
"version": "0.15.12",
|
4
4
|
"author": {
|
5
5
|
"email": "me@yunyoujun.cn",
|
6
6
|
"name": "YunYouJun",
|
@@ -19,12 +19,12 @@
|
|
19
19
|
"dependencies": {
|
20
20
|
"@explosions/fireworks": "^0.0.2",
|
21
21
|
"@iconify-json/ant-design": "^1.1.10",
|
22
|
-
"@iconify-json/simple-icons": "^1.1.
|
22
|
+
"@iconify-json/simple-icons": "^1.1.76",
|
23
23
|
"animejs": "^3.2.1"
|
24
24
|
},
|
25
25
|
"devDependencies": {
|
26
26
|
"@types/animejs": "^3.1.10",
|
27
|
-
"valaxy": "0.15.
|
27
|
+
"valaxy": "0.15.12",
|
28
28
|
"valaxy-addon-waline": "0.1.1"
|
29
29
|
}
|
30
30
|
}
|
package/styles/index.scss
CHANGED
@@ -1,5 +1,4 @@
|
|
1
1
|
@use "./layout" as *;
|
2
|
-
@use "./common/button.scss" as *;
|
3
2
|
@forward "star-markdown-css/src/scss/theme/yun.scss" with (
|
4
3
|
$colors: (
|
5
4
|
"primary": $c-primary,
|
@@ -7,6 +6,8 @@
|
|
7
6
|
);
|
8
7
|
|
9
8
|
// override the default style of star-markdown-css
|
9
|
+
@use "./common/button.scss" as *;
|
10
10
|
@use "./common/markdown.scss" as *;
|
11
|
+
|
11
12
|
@use 'valaxy/client/styles/components/code-group.scss' as *;
|
12
13
|
@use 'valaxy/client/styles/components/custom-block.scss' as *;
|