valaxy-theme-yun 0.13.0-0 → 0.13.1

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.
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PageData, Post } from 'valaxy'
3
- import { usePostTitle, useRuntimeConfig, useSiteConfig } from 'valaxy'
4
- import { StyleValue, computed, defineAsyncComponent } from 'vue'
3
+ import { usePostTitle, useSiteConfig } from 'valaxy'
4
+ import { StyleValue, computed } from 'vue'
5
5
  import { usePostProperty } from '../composables'
6
6
 
7
7
  const props = defineProps<{
@@ -9,23 +9,12 @@ const props = defineProps<{
9
9
  data?: PageData
10
10
  }>()
11
11
 
12
- const runtimeConfig = useRuntimeConfig()
13
12
  const siteConfig = useSiteConfig()
14
13
 
15
14
  const { styles, icon, color } = usePostProperty(props.frontmatter.type)
16
15
  const title = usePostTitle(computed(() => props.frontmatter))
17
16
 
18
17
  const aside = computed(() => props.frontmatter.aside !== false)
19
-
20
- // not import from 'valaxy-addon-waline' to judge
21
- const YunWaline = runtimeConfig.value.addons['valaxy-addon-waline']
22
- ? defineAsyncComponent(() => import('./YunWaline.vue'))
23
- : () => null
24
-
25
- // todo: refactor
26
- const YunTwikoo = runtimeConfig.value.addons['valaxy-addon-twikoo']
27
- ? defineAsyncComponent(() => import('./YunTwikoo.vue'))
28
- : () => null
29
18
  </script>
30
19
 
31
20
  <template>
@@ -60,10 +49,7 @@ const YunTwikoo = runtimeConfig.value.addons['valaxy-addon-twikoo']
60
49
  <slot name="main-nav-after" />
61
50
 
62
51
  <slot v-if="siteConfig.comment.enable && frontmatter.comment !== false" name="comment">
63
- <YunCard w="full" p="4" class="comment sm:p-6 lg:px-12 xl:px-16" :class="frontmatter.nav === false ? 'mt-4' : 0">
64
- <YunWaline />
65
- <YunTwikoo />
66
- </YunCard>
52
+ <YunComment :class="frontmatter.nav === false ? 'mt-4' : 0" />
67
53
  </slot>
68
54
 
69
55
  <slot name="main-footer-before" />
@@ -0,0 +1,25 @@
1
+ <script lang="ts" setup>
2
+ import { useRuntimeConfig } from 'valaxy'
3
+ import { defineAsyncComponent } from 'vue'
4
+
5
+ const runtimeConfig = useRuntimeConfig()
6
+
7
+ // not import from 'valaxy-addon-waline' to judge
8
+ const YunWaline = runtimeConfig.value.addons['valaxy-addon-waline']
9
+ ? defineAsyncComponent(() => import('./YunWaline.vue'))
10
+ : () => null
11
+
12
+ // todo: refactor
13
+ const YunTwikoo = runtimeConfig.value.addons['valaxy-addon-twikoo']
14
+ ? defineAsyncComponent(() => import('./YunTwikoo.vue'))
15
+ : () => null
16
+ </script>
17
+
18
+ <template>
19
+ <YunCard w="full" p="4" class="comment sm:p-6 lg:px-12 xl:px-16">
20
+ <ClientOnly>
21
+ <YunWaline />
22
+ <YunTwikoo />
23
+ </ClientOnly>
24
+ </YunCard>
25
+ </template>
package/layouts/home.vue CHANGED
@@ -17,7 +17,7 @@ const themeConfig = useThemeConfig()
17
17
 
18
18
  <YunBanner />
19
19
  <YunSay v-if="themeConfig.say.enable" w="full" />
20
- <YunCloud v-if="themeConfig.banner.cloud.enable" />
20
+ <YunCloud v-if="themeConfig.banner.cloud?.enable" />
21
21
  <YunNotice
22
22
  v-if="themeConfig.notice.enable"
23
23
  :content="themeConfig.notice.content" mt="4"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.13.0-0",
3
+ "version": "0.13.1",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -19,9 +19,9 @@
19
19
  "dependencies": {
20
20
  "@iconify-json/ant-design": "^1.1.4",
21
21
  "@iconify-json/simple-icons": "^1.1.41",
22
- "valaxy-addon-waline": "0.0.8"
22
+ "valaxy-addon-waline": "0.0.9"
23
23
  },
24
24
  "devDependencies": {
25
- "valaxy": "0.13.0-0"
25
+ "valaxy": "0.13.1"
26
26
  }
27
27
  }
package/types/index.d.ts CHANGED
@@ -15,7 +15,7 @@ export namespace YunTheme {
15
15
  * 首页下方的动态云
16
16
  * If you want change color of cloud, please change css var `--yun-c-cloud`
17
17
  */
18
- cloud: {
18
+ cloud?: {
19
19
  enable: boolean
20
20
  }
21
21
  }
package/valaxy.config.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import type { ResolvedValaxyOptions } from 'valaxy'
2
- import { defineTheme } from 'valaxy'
2
+ import { defineValaxyTheme } from 'valaxy'
3
3
  import type { Plugin } from 'vite'
4
4
  import type { ThemeConfig } from './types'
5
5
  import { defaultThemeConfig, generateSafelist } from './node'
@@ -27,10 +27,16 @@ function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
27
27
  }
28
28
  }
29
29
 
30
- export default defineTheme<ThemeConfig>((options) => {
30
+ export default defineValaxyTheme<ThemeConfig>((options) => {
31
31
  return {
32
32
  themeConfig: defaultThemeConfig,
33
33
  vite: {
34
+ build: {
35
+ rollupOptions: {
36
+ // add on demand external
37
+ external: ['valaxy-addon-twikoo', 'valaxy-addon-waline'],
38
+ },
39
+ },
34
40
  plugins: [ThemeVitePlugin(options)],
35
41
  },
36
42
  unocss: {