valaxy-theme-yun 0.11.2 → 0.11.4

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,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PageData, Post } from 'valaxy'
3
3
  import { useConfig, usePostTitle } from 'valaxy'
4
+ import { useAddonWaline } from 'valaxy-addon-waline'
4
5
  import { StyleValue, computed, defineAsyncComponent } from 'vue'
5
6
  import { usePostProperty } from '../composables'
6
7
 
@@ -15,13 +16,14 @@ const title = usePostTitle(computed(() => props.frontmatter))
15
16
 
16
17
  const aside = computed(() => props.frontmatter.aside !== false)
17
18
 
18
- const YunWaline = config.value.runtime.addons['valaxy-addon-waline'].enable
19
+ const YunWaline = useAddonWaline()
19
20
  ? defineAsyncComponent(() => import('./YunWaline.vue'))
20
21
  : () => null
21
22
 
22
- const YunTwikoo = config.value.runtime.addons['valaxy-addon-twikoo']?.enable
23
- ? defineAsyncComponent(() => import('./YunTwikoo.vue'))
24
- : () => null
23
+ // todo: refactor
24
+ // const YunTwikoo = useAddonWaline()
25
+ // ? defineAsyncComponent(() => import('./YunTwikoo.vue'))
26
+ // : () => null
25
27
  </script>
26
28
 
27
29
  <template>
@@ -57,8 +59,8 @@ const YunTwikoo = config.value.runtime.addons['valaxy-addon-twikoo']?.enable
57
59
 
58
60
  <slot v-if="config.comment.enable && frontmatter.comment !== false" name="comment">
59
61
  <YunCard w="full" p="4" class="comment sm:p-6 lg:px-12 xl:px-16" :class="frontmatter.nav === false ? 'mt-4' : 0">
60
- <YunWaline v-if="config.comment.waline.enable" />
61
- <YunTwikoo v-if="config.comment.twikoo.enable" />
62
+ <YunWaline />
63
+ <!-- <YunTwikoo /> -->
62
64
  </YunCard>
63
65
  </slot>
64
66
 
@@ -19,7 +19,9 @@ watch(() => props.posts, () => {
19
19
  props.posts.forEach((post) => {
20
20
  if (post.date) {
21
21
  const year = parseInt(formatDate(post.date, 'YYYY'))
22
- if (postList.value[year]) { postList.value[year].push(post) }
22
+ if (postList.value[year]) {
23
+ postList.value[year].push(post)
24
+ }
23
25
  else {
24
26
  years.value.push(year)
25
27
  postList.value[year] = [post]
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
- import { useConfig, useTwikoo } from 'valaxy'
2
+ // import { useConfig, useTwikoo } from 'valaxy'
3
3
 
4
- const config = useConfig()
5
- useTwikoo(config.value.comment.twikoo)
4
+ // const config = useConfig()
5
+ // useTwikoo(config.value.comment.twikoo)
6
6
  </script>
7
7
 
8
8
  <template>
@@ -1,8 +1,8 @@
1
1
  <script lang="ts" setup>
2
- import { useWalineOptions } from 'valaxy-addon-waline'
3
- const walineOptions = useWalineOptions()
2
+ import { useAddonWaline } from 'valaxy-addon-waline'
3
+ const addon = useAddonWaline()
4
4
  </script>
5
5
 
6
6
  <template>
7
- <WalineClient w="full" :options="walineOptions" />
7
+ <WalineClient w="full" :options="addon.options" />
8
8
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.11.2",
3
+ "version": "0.11.4",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -21,9 +21,9 @@
21
21
  "@docsearch/js": "^3.3.0",
22
22
  "@iconify-json/ant-design": "^1.1.4",
23
23
  "@iconify-json/simple-icons": "^1.1.36",
24
- "valaxy-addon-waline": "0.0.2"
24
+ "valaxy-addon-waline": "0.0.4"
25
25
  },
26
26
  "devDependencies": {
27
- "valaxy": "0.11.2"
27
+ "valaxy": "0.11.4"
28
28
  }
29
29
  }
package/valaxy.config.ts CHANGED
@@ -30,7 +30,6 @@ function ThemeVitePlugin(options: ResolvedValaxyOptions<ThemeConfig>): Plugin {
30
30
  export default defineTheme<ThemeConfig>((options) => {
31
31
  return {
32
32
  themeConfig: defaultThemeConfig,
33
- addons: ['valaxy-addon-waline'],
34
33
  vite: {
35
34
  plugins: [ThemeVitePlugin(options)],
36
35
  },