valaxy-theme-yun 0.17.4 → 0.18.0-beta.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.
@@ -88,15 +88,15 @@ onContentUpdated(() => {
88
88
 
89
89
  <div p="x-4 b-8" class="sm:px-6 lg:px-12 xl:px-16" w="full">
90
90
  <slot name="main-content">
91
- <Transition appear>
92
- <ValaxyMd :frontmatter="frontmatter">
93
- <YunAiExcerpt v-if="frontmatter.excerpt_type === 'ai' && frontmatter.excerpt" />
94
- <YunMdTimeWarning />
95
-
96
- <slot name="main-content-md" />
97
- <slot />
98
- </ValaxyMd>
99
- </Transition>
91
+ <!-- <Transition appear> -->
92
+ <ValaxyMd :frontmatter="frontmatter">
93
+ <YunAiExcerpt v-if="frontmatter.excerpt_type === 'ai' && frontmatter.excerpt" />
94
+ <YunMdTimeWarning />
95
+
96
+ <slot name="main-content-md" />
97
+ <slot />
98
+ </ValaxyMd>
99
+ <!-- </Transition> -->
100
100
  </slot>
101
101
 
102
102
  <slot name="main-content-after" />
@@ -36,7 +36,8 @@ const isDesc = ref(true)
36
36
  const sortedYears = computed(() => {
37
37
  const y = years.value
38
38
  const arr = y.sort((a, b) => b - a)
39
- return isDesc.value ? arr : arr.reverse()
39
+ // avoid mutating the original array
40
+ return isDesc.value ? arr : [...arr].reverse()
40
41
  })
41
42
  </script>
42
43
 
package/layouts/home.vue CHANGED
@@ -10,6 +10,11 @@ const themeConfig = useThemeConfig()
10
10
 
11
11
  const route = useRoute()
12
12
  const isPage = computed(() => route.path.startsWith('/page'))
13
+
14
+ const showNotice = computed(() => {
15
+ const notice = themeConfig.value.notice
16
+ return notice.enable && (isPage.value ? !notice.hideInPages : true)
17
+ })
13
18
  </script>
14
19
 
15
20
  <template>
@@ -25,7 +30,7 @@ const isPage = computed(() => route.path.startsWith('/page'))
25
30
  </template>
26
31
 
27
32
  <YunNotice
28
- v-if="themeConfig.notice.enable"
33
+ v-if="showNotice"
29
34
  :content="themeConfig.notice.content" mt="4"
30
35
  />
31
36
 
package/layouts/post.vue CHANGED
@@ -41,11 +41,6 @@ useSchemaOrg(
41
41
  </script>
42
42
 
43
43
  <template>
44
- <YunSidebar v-if="$slots['sidebar-child']">
45
- <slot name="sidebar-child" />
46
- </YunSidebar>
47
- <YunSidebar v-else />
48
-
49
44
  <RouterView v-slot="{ Component }">
50
45
  <component :is="Component">
51
46
  <template #main-header-after>
package/node/config.ts CHANGED
@@ -39,6 +39,7 @@ export const defaultThemeConfig: ThemeConfig = {
39
39
 
40
40
  notice: {
41
41
  enable: false,
42
+ hideInPages: false,
42
43
  content: '',
43
44
  },
44
45
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.17.4",
3
+ "version": "0.18.0-beta.0",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -25,7 +25,7 @@
25
25
  },
26
26
  "devDependencies": {
27
27
  "@types/animejs": "^3.1.12",
28
- "valaxy": "0.17.4",
28
+ "valaxy": "0.18.0-beta.0",
29
29
  "valaxy-addon-waline": "0.1.1"
30
30
  }
31
31
  }
package/setup/main.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  import { defineAppSetup } from 'valaxy'
2
2
 
3
+ import dayjs from 'dayjs'
4
+ import timezone from 'dayjs/plugin/timezone'
5
+
3
6
  export default defineAppSetup((_ctx) => {
4
7
  // can do for setup
8
+
9
+ // for types in time warning
10
+ dayjs.extend(timezone)
5
11
  })
@@ -42,6 +42,7 @@
42
42
  img {
43
43
  margin: 0.5rem auto;
44
44
  height: auto;
45
+ max-width: min(92%, 800px);
45
46
  }
46
47
 
47
48
  p {
package/types/index.d.ts CHANGED
@@ -106,6 +106,11 @@ export interface ThemeConfig {
106
106
  */
107
107
  notice: {
108
108
  enable: boolean
109
+ /**
110
+ * @en Hide in /pages/[page]
111
+ * @zh 在 /pages/[page] 中隐藏
112
+ */
113
+ hideInPages?: boolean
109
114
  content: string
110
115
  }
111
116