valaxy-theme-yun 0.14.22 → 0.14.23

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,7 +8,7 @@ defineProps<{
8
8
  </script>
9
9
 
10
10
  <template>
11
- <a class="yun-album-list-item" :href="album.url">
11
+ <AppLink class="yun-album-list-item" :to="album.url">
12
12
  <figure :title="album.desc">
13
13
  <img
14
14
  loading="lazy"
@@ -21,5 +21,5 @@ defineProps<{
21
21
  「{{ album.caption }}」
22
22
  </figcaption>
23
23
  </figure>
24
- </a>
24
+ </AppLink>
25
25
  </template>
@@ -1,7 +1,4 @@
1
1
  <script lang="ts" setup>
2
- import Lightgallery from 'lightgallery/vue'
3
- import 'lightgallery/scss/lightgallery.scss'
4
-
5
2
  import type { Photo } from 'valaxy'
6
3
 
7
4
  defineProps<{
@@ -10,7 +7,5 @@ defineProps<{
10
7
  </script>
11
8
 
12
9
  <template>
13
- <Lightgallery class="yun-photo-list">
14
- <YunPhoto v-for="photo in photos" :key="photo.src" :photo="photo" />
15
- </Lightgallery>
10
+ <VAGallery :photos="photos" />
16
11
  </template>
@@ -1,7 +1,7 @@
1
1
  <script lang="ts" setup>
2
2
  import { defineWebPage, useSchemaOrg } from '@vueuse/schema-org'
3
- import { useFrontmatter, usePostTitle } from 'valaxy'
4
- import { computed } from 'vue'
3
+ import { useFrontmatter, usePostTitle, useRuntimeConfig } from 'valaxy'
4
+ import { computed, defineAsyncComponent } from 'vue'
5
5
  import { useI18n } from 'vue-i18n'
6
6
  import { useRouter } from 'vue-router'
7
7
 
@@ -20,6 +20,12 @@ useSchemaOrg([
20
20
  ])
21
21
 
22
22
  const photos = computed(() => frontmatter.value.photos || [])
23
+
24
+ const runtimeConfig = useRuntimeConfig()
25
+
26
+ const YunGallery = runtimeConfig.value.addons['valaxy-addon-lightgallery']
27
+ ? defineAsyncComponent(() => import('../components/YunGallery.vue'))
28
+ : () => null
23
29
  </script>
24
30
 
25
31
  <template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.14.22",
3
+ "version": "0.14.23",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -20,11 +20,10 @@
20
20
  "@iconify-json/ant-design": "^1.1.5",
21
21
  "@iconify-json/simple-icons": "^1.1.47",
22
22
  "animejs": "^3.2.1",
23
- "lightgallery": "^2.7.1",
24
23
  "valaxy-addon-waline": "0.1.0"
25
24
  },
26
25
  "devDependencies": {
27
26
  "@types/animejs": "^3.1.7",
28
- "valaxy": "0.14.22"
27
+ "valaxy": "0.14.23"
29
28
  }
30
29
  }
@@ -1,60 +0,0 @@
1
- <script lang="ts" setup>
2
- import type { Photo } from 'valaxy'
3
- import { computed } from 'vue'
4
-
5
- const props = defineProps<{
6
- photo: Photo
7
- }>()
8
-
9
- const subHtml = computed(() => {
10
- return `<h4>${props.photo.caption}</h4><p>${props.photo.desc}</p>`
11
- })
12
- </script>
13
-
14
- <template>
15
- <figure class="yun-photo-list-item" :data-src="photo.src" :data-sub-html="subHtml">
16
- <img class="yun-photo-list-cover" :src="photo.src" loading="lazy" :alt="photo.caption">
17
- <figcaption>
18
- {{ photo.caption }}
19
- </figcaption>
20
- </figure>
21
- </template>
22
-
23
- <style lang="scss">
24
- .yun {
25
- &-photo-list {
26
- display: flex;
27
- justify-content: center;
28
- flex-wrap: wrap;
29
- }
30
-
31
- &-photo-list-item {
32
- display: inline-flex;
33
- position: relative;
34
- width: 15rem;
35
- margin: 1.5rem;
36
- cursor: pointer;
37
-
38
- img {
39
- box-sizing: border-box;
40
- vertical-align: bottom;
41
- display: inline-flex;
42
- border: 0.25rem solid white;
43
- box-shadow: 0 8px 10px rgba(#000000, 0.1);
44
- width: 100%;
45
- height: 10rem;
46
- object-fit: cover;
47
- background-color: #eee;
48
- }
49
-
50
- figcaption {
51
- position: absolute;
52
- bottom: -1.8rem;
53
- display: block;
54
- text-align: center;
55
- width: 100%;
56
- font-size: 0.9rem;
57
- }
58
- }
59
- }
60
- </style>