valaxy-theme-yun 0.11.1 → 0.11.3

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/App.vue ADDED
@@ -0,0 +1,22 @@
1
+ <script lang="ts" setup>
2
+ import { useHead } from '@vueuse/head'
3
+ import { useConfig } from 'valaxy'
4
+
5
+ useHead({
6
+ link: [
7
+ {
8
+ rel: 'stylesheet',
9
+ href: 'https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@900&display=swap',
10
+ },
11
+ ],
12
+ })
13
+
14
+ const config = useConfig()
15
+ </script>
16
+
17
+ <template>
18
+ <slot name="bg">
19
+ <YunBg v-if="config.themeConfig.bg_image.enable" />
20
+ </slot>
21
+ <YunSearch v-if="config.search.enable" />
22
+ </template>
@@ -1,7 +1,8 @@
1
1
  <script lang="ts" setup>
2
2
  import type { PageData, Post } from 'valaxy'
3
3
  import { useConfig, usePostTitle } from 'valaxy'
4
- import { computed, defineAsyncComponent } from 'vue'
4
+ import { useAddonWaline } from 'valaxy-addon-waline'
5
+ import { StyleValue, computed, defineAsyncComponent } from 'vue'
5
6
  import { usePostProperty } from '../composables'
6
7
 
7
8
  const props = defineProps<{
@@ -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.comment.waline.enable
19
+ const YunWaline = useAddonWaline()
19
20
  ? defineAsyncComponent(() => import('./YunWaline.vue'))
20
21
  : () => null
21
22
 
22
- const YunTwikoo = config.value.comment.waline.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>
@@ -29,7 +31,7 @@ const YunTwikoo = config.value.comment.waline.enable
29
31
  <div w="full" flex="~">
30
32
  <slot name="main">
31
33
  <div class="content" :class="!aside && 'no-aside'" flex="~ col grow" w="full" p="l-4 lt-md:0">
32
- <YunCard :cover="frontmatter.cover" m="0" class="relative" :style="styles">
34
+ <YunCard :cover="frontmatter.cover" m="0" class="relative" :style="styles as StyleValue">
33
35
  <slot name="main-header">
34
36
  <YunPageHeader :title="title" :icon="frontmatter.icon || icon" :color="frontmatter.color || color" :cover="frontmatter.cover" />
35
37
  </slot>
@@ -57,8 +59,8 @@ const YunTwikoo = config.value.comment.waline.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
 
@@ -56,7 +56,7 @@ const lintStyle = computed(() => (
56
56
  // banner
57
57
  --banner-line-color: black;
58
58
  --banner-char-color: black;
59
- --banner-char-bg-color: rgba(white, 0.5);
59
+ --banner-char-bg-color: rgba(255, 255, 255, 0.5);
60
60
  --banner-char-hover-color: white;
61
61
  }
62
62
 
@@ -64,7 +64,7 @@ const lintStyle = computed(() => (
64
64
  // banner
65
65
  --banner-line-color: white;
66
66
  --banner-char-color: white;
67
- --banner-char-bg-color: rgba(black, 0.5);
67
+ --banner-char-bg-color: rgba(0, 0, 0, 0.5);
68
68
  --banner-char-hover-color: black;
69
69
  }
70
70
  </style>
@@ -98,7 +98,7 @@ const router = useRouter()
98
98
  .site-name {
99
99
  color: var(--va-c-text);
100
100
  font-family: get-css-var('font-serif');
101
- font-weight: get-css-var('font-serif-weight');
101
+ font-weight: 900;
102
102
  }
103
103
 
104
104
  .site-subtitle {
@@ -1,6 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { useI18n } from 'vue-i18n'
3
3
  import type { Post } from 'valaxy'
4
+ import { StyleValue } from 'vue'
4
5
  import { usePostProperty } from '../composables'
5
6
 
6
7
  const props = defineProps<{
@@ -13,7 +14,7 @@ const { icon, styles } = usePostProperty(props.post.type)
13
14
  </script>
14
15
 
15
16
  <template>
16
- <YunCard m="y-4 auto" :class="post.cover ? 'post-card-image' : 'post-card'" :style="styles">
17
+ <YunCard m="y-4 auto" :class="post.cover ? 'post-card-image' : 'post-card'" :style="styles as StyleValue">
17
18
  <div class="flex flex-1 of-hidden justify-start items-start post-card-info" w="full">
18
19
  <img
19
20
  v-if="post.cover"
@@ -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 { useConfig } from 'valaxy'
3
- const config = useConfig()
2
+ import { useAddonWaline } from 'valaxy-addon-waline'
3
+ const addon = useAddonWaline()
4
4
  </script>
5
5
 
6
6
  <template>
7
- <WalineClient w="full" :server-u-r-l="config.comment.waline.serverURL" :cdn="config.cdn.prefix" />
7
+ <WalineClient w="full" :options="addon.options" />
8
8
  </template>
@@ -1,4 +1,4 @@
1
- import type { StyleValue } from 'vue'
1
+ import type { ComputedRef, StyleValue } from 'vue'
2
2
  import { computed } from 'vue'
3
3
  import { useThemeConfig } from './config'
4
4
 
@@ -6,12 +6,16 @@ import { useThemeConfig } from './config'
6
6
  * get type card property
7
7
  * todo: test reactive
8
8
  */
9
- export function usePostProperty(type?: string) {
9
+ export function usePostProperty(type?: string): {
10
+ color: string
11
+ icon: string
12
+ styles: StyleValue | undefined | ComputedRef<StyleValue | undefined>
13
+ } {
10
14
  if (!type) {
11
15
  return {
12
16
  color: '',
13
17
  icon: '',
14
- styles: {},
18
+ styles: undefined,
15
19
  }
16
20
  }
17
21
 
@@ -23,10 +27,12 @@ export function usePostProperty(type?: string) {
23
27
  const color = themeConfig.value.types[type].color
24
28
  const icon = themeConfig.value.types[type].icon
25
29
 
26
- const styles = computed(() => {
27
- return {
28
- '--card-c-primary': type && color,
29
- } as StyleValue
30
+ const styles = computed<StyleValue | undefined>(() => {
31
+ return type
32
+ ? ({
33
+ '--card-c-primary': color,
34
+ })
35
+ : undefined
30
36
  })
31
37
 
32
38
  return {
package/layouts/home.vue CHANGED
@@ -1,16 +1,11 @@
1
1
  <script lang="ts" setup>
2
- import { useAppStore, useConfig, useLayout } from 'valaxy'
3
- import { useThemeConfig } from '../composables'
2
+ import { useAppStore, useLayout } from 'valaxy'
4
3
 
5
4
  const app = useAppStore()
6
- const config = useConfig()
7
- const themeConfig = useThemeConfig()
8
5
  const isHome = useLayout('home')
9
6
  </script>
10
7
 
11
8
  <template>
12
- <YunBg v-if="themeConfig.bg_image.enable" />
13
-
14
9
  <main class="yun-main justify-center items-center" :class="(isHome && !app.isSidebarOpen) && 'pl-0'" flex="~ col" w="full">
15
10
  <ValaxySidebar>
16
11
  <slot name="sidebar">
@@ -29,6 +24,4 @@ const isHome = useLayout('home')
29
24
 
30
25
  <YunFooter />
31
26
  </main>
32
-
33
- <YunSearch v-if="config.search.enable" />
34
27
  </template>
@@ -1,14 +1,4 @@
1
- <script lang="ts" setup>
2
- import { useConfig } from 'valaxy'
3
-
4
- const config = useConfig()
5
- </script>
6
-
7
1
  <template>
8
- <slot name="bg">
9
- <YunBg v-if="config.themeConfig.bg_image.enable" />
10
- </slot>
11
-
12
2
  <ValaxySidebar>
13
3
  <slot name="sidebar">
14
4
  <YunSidebar v-if="$slots['sidebar-child']">
@@ -48,7 +38,6 @@ const config = useConfig()
48
38
  </component>
49
39
  </router-view>
50
40
 
51
- <YunSearch v-if="config.search.enable" />
52
41
  <YunBackToTop />
53
42
  </template>
54
43
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.11.1",
3
+ "version": "0.11.3",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -17,13 +17,13 @@
17
17
  "main": "node/index.ts",
18
18
  "types": "types/index.d.ts",
19
19
  "dependencies": {
20
- "@docsearch/css": "^3.2.1",
21
- "@docsearch/js": "^3.2.1",
22
- "@iconify-json/ant-design": "^1.1.3",
23
- "@iconify-json/simple-icons": "^1.1.28",
24
- "valaxy-addon-waline": "0.0.2"
20
+ "@docsearch/css": "^3.3.0",
21
+ "@docsearch/js": "^3.3.0",
22
+ "@iconify-json/ant-design": "^1.1.4",
23
+ "@iconify-json/simple-icons": "^1.1.36",
24
+ "valaxy-addon-waline": "0.0.4"
25
25
  },
26
26
  "devDependencies": {
27
- "valaxy": "0.11.1"
27
+ "valaxy": "0.11.3"
28
28
  }
29
29
  }
@@ -4,6 +4,9 @@
4
4
  :root {
5
5
  @include set-css-var-from-map($common);
6
6
  @include set-css-var-from-map($z-index, "z");
7
+
8
+ // z-index
9
+ --va-z-overlay: var(--yun-z-backdrop);
7
10
  }
8
11
 
9
12
  :root {
package/styles/vars.scss CHANGED
@@ -36,6 +36,7 @@ $z-index: map.merge(
36
36
  (
37
37
  "cloud": 8,
38
38
  "go-down": 9,
39
+ "backdrop": 9,
39
40
  "sidebar": 10,
40
41
  "fireworks": 11,
41
42
  "menu-btn": 20,
package/unocss.config.ts CHANGED
@@ -6,11 +6,18 @@ export default defineConfig({
6
6
  ['yun-card', 'm-auto transition yun-transition shadow hover:shadow-lg'],
7
7
  ],
8
8
  rules: [
9
- ['yun-text-light', {
10
- color: 'var(--va-c-text-light)',
11
- }],
12
- ['yun-transition', {
13
- 'transition-duration': 'var(--va-transition-duration)',
14
- }],
9
+ [
10
+ 'yun-text-light',
11
+ {
12
+ color: 'var(--va-c-text-light)',
13
+ },
14
+ ],
15
+ [
16
+ 'yun-transition',
17
+ {
18
+ 'transition-duration': 'var(--va-transition-duration)',
19
+ },
20
+ ],
15
21
  ],
22
+ // web fonts is so big, let the user decide
16
23
  })
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
  },