valaxy-theme-yun 0.15.10 → 0.15.11

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.
@@ -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 :frontmatter="frontmatter" />
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
- <router-link v-if="categoryItem.title" :to="categoryItem.path || ''" class="inline-flex items-center">
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
- </router-link>
90
+ </RouterLink>
91
91
  </template>
92
92
  </li>
93
93
  </ul>
@@ -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, toggleDark } from 'valaxy'
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="toggleDark()">
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
- <transition
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
- </transition>
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 type { Post } from 'valaxy'
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 props = defineProps<{
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 30 days ago, show a warning
20
- * default 30 days, you can set `time_warning` in frontmatter to change it
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(props.frontmatter.updated).valueOf()
24
- if (typeof props.frontmatter.time_warning === 'number')
25
- return diff > props.frontmatter.time_warning
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 props.frontmatter.time_warning || diff > 30 * 24 * 60 * 60 * 1000
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(frontmatter.updated).fromNow() }) }}
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
- <router-link class="site-author-avatar" to="/about">
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
- </router-link>
15
+ </RouterLink>
16
16
  <div
17
17
  class="site-author-name leading-6"
18
18
  m="t-0 b-4"
19
19
  >
20
- <router-link to="/about">
20
+ <RouterLink to="/about">
21
21
  {{ siteConfig.author.name }}
22
- </router-link>
22
+ </RouterLink>
23
23
  </div>
24
- <router-link v-if="router.hasRoute('about-site')" to="/about/site" class="site-name">
24
+ <RouterLink v-if="router.hasRoute('about-site')" to="/about/site" class="site-name">
25
25
  {{ siteConfig.title }}
26
- </router-link>
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
- <router-link
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
- </router-link>
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
- <router-link :to="post.path || ''" class="post-title-link">
72
+ <RouterLink :to="post.path || ''" class="post-title-link">
73
73
  {{ post.title }}
74
- </router-link>
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
- <router-link v-if="prev" class="post-nav-prev" :to="prev.path || ''" :title="prev.title">
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
- </router-link>
13
+ </RouterLink>
14
14
  </div>
15
15
  <div class="post-nav-item">
16
- <router-link v-if="next" :to="next.path || ''" :title="next.title" class="post-nav-next">
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
- </router-link>
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
- <router-link
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
- </router-link>
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
- <router-link class="site-link-item yun-icon-btn" to="/" :title="t('menu.home')">
17
+ <RouterLink class="site-link-item yun-icon-btn" to="/" :title="t('menu.home')">
18
18
  <div i-ri-home-4-line />
19
- </router-link>
19
+ </RouterLink>
20
20
 
21
- <router-link class="site-link-item" to="/archives/" :title="t('menu.archives')">
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
- </router-link>
25
- <router-link class="site-link-item" to="/categories/" :title="t('menu.categories')">
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
- </router-link>
29
- <router-link class="site-link-item" to="/tags/" :title="t('menu.tags')">
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
- </router-link>
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" />
@@ -9,5 +9,5 @@ const addon = addonWaline.useAddonWaline()
9
9
  </script>
10
10
 
11
11
  <template>
12
- <WalineClient w="full" :options="addon.options" />
12
+ <WalineClient w="full" :options="addon.options || {}" />
13
13
  </template>
@@ -10,4 +10,4 @@
10
10
 
11
11
  如「作者头像」、「站点名称」等属于通用信息,请在 `site.config.ts` 中配置。
12
12
 
13
- 可参见 [Site Config | Valaxy Docs](https://valaxy.site/guide/config#site-config)。
13
+ 可参见 [Site Config | Valaxy Docs](https://valaxy.site/guide/config/#site-config)。
package/layouts/404.vue CHANGED
@@ -14,7 +14,7 @@ const { back } = useBack()
14
14
  404
15
15
  </div>
16
16
 
17
- <router-view />
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);
@@ -29,7 +29,7 @@ const albums = computed(() => frontmatter.value.albums || [])
29
29
  {{ t('counter.albums', albums.length) }}
30
30
  </div>
31
31
  <YunAlbumList :albums="albums" />
32
- <router-view />
32
+ <RouterView />
33
33
  </template>
34
34
  </Layout>
35
35
  </template>
@@ -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
- <router-view />
26
+ <RouterView />
27
27
  <YunPostCollapse :posts="site.postList" />
28
28
  </template>
29
29
  </Layout>
@@ -52,7 +52,7 @@ useSchemaOrg([
52
52
  {{ t('counter.categories', categories.children.length) }}
53
53
  </div>
54
54
  <YunCategories :categories="categories.children" />
55
- <router-view />
55
+ <RouterView />
56
56
  </template>
57
57
 
58
58
  <template #main-nav-before>
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <Layout>
3
3
  <template #content>
4
- <router-view />
4
+ <RouterView />
5
5
  </template>
6
6
  </Layout>
7
7
  </template>
@@ -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
- <router-view />
51
+ <RouterView />
52
52
  </template>
53
53
  </Layout>
54
54
  </template>
package/layouts/home.vue CHANGED
@@ -32,7 +32,7 @@ const isPage = computed(() => route.path.startsWith('/page'))
32
32
  <slot name="board" />
33
33
 
34
34
  <slot>
35
- <router-view />
35
+ <RouterView />
36
36
  </slot>
37
37
 
38
38
  <YunFooter />
@@ -8,7 +8,7 @@ import { asAny } from 'valaxy'
8
8
  </YunSidebar>
9
9
  <YunSidebar v-else />
10
10
 
11
- <router-view v-slot="{ Component }">
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
- </router-view>
39
+ </RouterView>
40
40
 
41
41
  <YunBackToTop />
42
42
  </template>
package/layouts/tags.vue CHANGED
@@ -82,7 +82,7 @@ const title = usePostTitle(frontmatter)
82
82
  />
83
83
  </div>
84
84
 
85
- <router-view />
85
+ <RouterView />
86
86
  </template>
87
87
 
88
88
  <template #main-nav-before>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.15.10",
3
+ "version": "0.15.11",
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.75",
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.10",
27
+ "valaxy": "0.15.11",
28
28
  "valaxy-addon-waline": "0.1.1"
29
29
  }
30
30
  }
@@ -0,0 +1,21 @@
1
+ // transition
2
+ ::view-transition-old(root),
3
+ ::view-transition-new(root) {
4
+ animation: none;
5
+ mix-blend-mode: normal;
6
+ }
7
+
8
+ /* 进入dark模式和退出dark模式时,两个图像的位置顺序正好相反 */
9
+ .dark::view-transition-old(root) {
10
+ z-index: 9999;
11
+ }
12
+ .dark::view-transition-new(root) {
13
+ z-index: 1;
14
+ }
15
+
16
+ ::view-transition-old(root) {
17
+ z-index: 1;
18
+ }
19
+ ::view-transition-new(root) {
20
+ z-index: 9999;
21
+ }
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,9 @@
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
+ @use './common/effects.scss' as *;
12
+
11
13
  @use 'valaxy/client/styles/components/code-group.scss' as *;
12
14
  @use 'valaxy/client/styles/components/custom-block.scss' as *;