valaxy-theme-yun 0.25.7 → 0.25.9

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.
@@ -8,9 +8,19 @@ defineProps<{
8
8
 
9
9
  <template>
10
10
  <RouterLink
11
- class="inline-flex rounded p-4 h-50 w-40 bg-gray-100 dark:bg-dark-300 shadow"
12
- :to="`/collections/${collection.id}`"
11
+ :to="`/collections/${collection.key}/`"
12
+ :title="collection.title"
13
+ class="flex flex-col gap-2 hover:border-b-0!"
13
14
  >
14
- Book
15
+ <div class="inline-flex rounded h-40 w-30 bg-gray-100 dark:bg-dark-300 shadow hover:shadow-md transition overflow-hidden">
16
+ <img
17
+ :src="collection.cover"
18
+ :alt="collection.title"
19
+ class="flex size-full object-cover max-w-none"
20
+ >
21
+ </div>
22
+ <div class="text-sm font-bold text-center op-80 hover:op-100">
23
+ {{ collection.title }}
24
+ </div>
15
25
  </RouterLink>
16
26
  </template>
@@ -0,0 +1,77 @@
1
+ <script setup lang="ts">
2
+ import { useCollection } from 'valaxy'
3
+
4
+ const { collection } = useCollection()
5
+ </script>
6
+
7
+ <template>
8
+ <YunCard class="collection p-4 min-h-sm justify-start items-start" flex="~ col gap-1">
9
+ <section class="yun-sidebar-item">
10
+ <RouterLink :to="`/collections/${collection.key}/`" class="title">
11
+ {{ collection.title }}
12
+ </RouterLink>
13
+ <div class="items">
14
+ <div v-for="item in collection.items" :key="item.key" class="item">
15
+ <div class="indicator" />
16
+ <RouterLink
17
+ :to="`/collections/${collection.key}/${item.key}`"
18
+ >
19
+ <p class="text">
20
+ {{ item.title }}
21
+ </p>
22
+ </RouterLink>
23
+ </div>
24
+ </div>
25
+ </section>
26
+ </YunCard>
27
+ </template>
28
+
29
+ <style lang="scss">
30
+ .collection {
31
+ .yun-sidebar-item {
32
+ .title {
33
+ font-weight: 500;
34
+ font-size: 16px;
35
+ color: var(--va-c-text-1);
36
+ }
37
+
38
+ .items {
39
+ border-left: 1px solid var(--va-c-divider);
40
+
41
+ color: #666;
42
+ font-size: 0.9em;
43
+
44
+ padding-left: 16px;
45
+
46
+ .item {
47
+ .text {
48
+ color: var(--va-c-text-2);
49
+ flex-grow: 1;
50
+ padding: 4px 0;
51
+ font-size: 14px;
52
+ line-height: 24px;
53
+ transition: color .25s;
54
+ }
55
+
56
+ .indicator {
57
+ border-radius: 2px;
58
+ width: 2px;
59
+ transition: background-color .25s;
60
+ position: absolute;
61
+ top: 6px;
62
+ bottom: 6px;
63
+ }
64
+
65
+ .router-link-active {
66
+ color: var(--va-c-primary);
67
+ font-weight: 500;
68
+
69
+ .text {
70
+ color: var(--va-c-primary);
71
+ }
72
+ }
73
+ }
74
+ }
75
+ }
76
+ }
77
+ </style>
@@ -1,12 +1,26 @@
1
1
  <script setup lang="ts">
2
+ import { useFrontmatter } from 'valaxy'
3
+ import { computed } from 'vue'
2
4
  import { useYunAppStore } from '../../stores'
3
5
 
4
6
  const yun = useYunAppStore()
7
+
8
+ const fm = useFrontmatter()
9
+ const showLeftLayout = computed(() => {
10
+ if (typeof fm.value.sidebar !== 'undefined')
11
+ return fm.value.sidebar
12
+ return yun.size.isLg
13
+ })
5
14
  </script>
6
15
 
7
16
  <template>
8
- <div v-if="yun.size.isLg" flex="~ col" class="gap-4 sticky top-$yun-margin-top w-80">
9
- <YunSidebarCard />
10
- <YunAdBoard />
17
+ <div
18
+ v-if="showLeftLayout"
19
+ flex="~ col" class="gap-4 sticky top-$yun-margin-top w-80"
20
+ >
21
+ <slot>
22
+ <YunSidebarCard />
23
+ <YunAdBoard />
24
+ </slot>
11
25
  </div>
12
26
  </template>
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import { defineWebPage, useSchemaOrg } from '@unhead/schema-org/vue'
3
- import { useCategories, useFrontmatter, usePostTitle, useSiteStore } from 'valaxy'
3
+ import { useCategories, useFrontmatter, useSiteStore, useValaxyI18n } from 'valaxy'
4
4
  import { computed } from 'vue'
5
5
  import { useI18n } from 'vue-i18n'
6
6
  import { useRoute } from 'vue-router'
@@ -36,7 +36,7 @@ const posts = computed(() => {
36
36
  return list
37
37
  })
38
38
 
39
- const title = usePostTitle(frontmatter)
39
+ const { $tO } = useValaxyI18n()
40
40
 
41
41
  useSchemaOrg([
42
42
  defineWebPage({
@@ -53,7 +53,7 @@ useSchemaOrg([
53
53
  <component :is="Component">
54
54
  <template #main-header>
55
55
  <YunPageHeader
56
- :title="title || t('menu.categories')"
56
+ :title="$tO(frontmatter.title) || t('menu.categories')"
57
57
  :icon="pageIcon"
58
58
  :color="frontmatter.color"
59
59
  :page-title-class="frontmatter.pageTitleClass"
@@ -4,12 +4,28 @@
4
4
 
5
5
  <template>
6
6
  <YunLayoutWrapper>
7
+ <YunLayoutLeft>
8
+ <YunCollectionSidebar />
9
+ </YunLayoutLeft>
10
+
7
11
  <RouterView v-slot="{ Component }">
8
12
  <component :is="Component">
9
- <div flex="~ wrap" gap="4">
10
- Collection
11
- </div>
13
+ <template #main-header-after>
14
+ <YunMainHeaderAfter />
15
+ </template>
16
+ <template #main-content-after>
17
+ <YunMainContentAfter />
18
+ </template>
19
+ <template #aside-custom>
20
+ <slot name="aside-custom" />
21
+ </template>
22
+
23
+ <template #main-nav>
24
+ <!-- -->
25
+ </template>
12
26
  </component>
13
27
  </RouterView>
28
+
29
+ <YunLayoutRight />
14
30
  </YunLayoutWrapper>
15
31
  </template>
@@ -1,19 +1,36 @@
1
1
  <script setup lang="ts">
2
- import { useCollections } from 'valaxy'
2
+ import { useCollections, useFrontmatter, useValaxyI18n } from 'valaxy'
3
+ import { useI18n } from 'vue-i18n'
3
4
 
5
+ const { t } = useI18n()
6
+ const { $tO } = useValaxyI18n()
7
+ const fm = useFrontmatter()
4
8
  const { collections } = useCollections()
5
9
  </script>
6
10
 
7
11
  <template>
8
12
  <YunLayoutWrapper>
13
+ <YunLayoutLeft />
14
+
9
15
  <RouterView v-slot="{ Component }">
10
16
  <component :is="Component">
11
- <div flex="~ wrap" gap="4">
12
- <YunCollectionItem
13
- v-for="collection in collections" :key="collection.id"
14
- :collection="collection"
17
+ <template #main-header>
18
+ <YunPageHeader
19
+ :title="$tO(fm.title) || t('menu.collections')"
20
+ :icon="fm.icon"
21
+ :page-title-class="fm.pageTitleClass"
15
22
  />
16
- </div>
23
+ </template>
24
+
25
+ <template #main-content>
26
+ <div flex="~ wrap" gap="6">
27
+ <YunCollectionItem
28
+ v-for="collection in collections"
29
+ :key="collection.key"
30
+ :collection="collection"
31
+ />
32
+ </div>
33
+ </template>
17
34
  </component>
18
35
  </RouterView>
19
36
  </YunLayoutWrapper>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
3
  "type": "module",
4
- "version": "0.25.7",
4
+ "version": "0.25.9",
5
5
  "author": {
6
6
  "email": "me@yunyoujun.cn",
7
7
  "name": "YunYouJun",
@@ -32,8 +32,8 @@
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/animejs": "^3.1.13",
35
- "valaxy": "0.25.7",
36
- "valaxy-addon-waline": "0.2.1"
35
+ "valaxy-addon-waline": "0.2.1",
36
+ "valaxy": "0.25.9"
37
37
  },
38
38
  "scripts": {
39
39
  "release": "bumpp && pnpm publish"