valaxy-theme-yun 0.14.14 → 0.14.16

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.
@@ -37,7 +37,7 @@ const { data } = useRandomData(props.links, props.random)
37
37
  </div>
38
38
  </template>
39
39
 
40
- <stye lang="scss">
40
+ <stye lang="scss" scoped>
41
41
  .link-item {
42
42
  display: inline-flex;
43
43
  }
@@ -53,7 +53,7 @@ const { data } = useRandomData(props.links, props.random)
53
53
  }
54
54
 
55
55
  .link-url {
56
- --smc-primary: var(--primary-color);
56
+ --smc-link-color: var(--primary-color);
57
57
 
58
58
  display: inline-flex;
59
59
  text-align: center;
@@ -57,11 +57,11 @@ const { icon, styles } = usePostProperty(props.post.type)
57
57
 
58
58
  <!-- always show -->
59
59
  <div w="full" class="yun-card-actions flex justify-between" border="t" text="sm">
60
- <div class="inline-flex">
61
- <YunPostCategories m="l-2" :categories="post.categories" />
60
+ <div class="post-categories inline-flex" flex="wrap 1">
61
+ <YunPostCategories m="l-1" :categories="post.categories" />
62
62
  </div>
63
63
 
64
- <div class="post-tags inline-flex" m="r-2">
64
+ <div class="post-tags inline-flex" flex="wrap 1" justify="end" m="1">
65
65
  <template v-if="post.tags">
66
66
  <YunPostTags :tags="post.tags" />
67
67
  </template>
@@ -12,9 +12,11 @@ defineProps<{
12
12
  path: '/categories/',
13
13
  query: { category: Array.isArray(categories) ? categories[categories.length - 1] : categories },
14
14
  }"
15
- class="post-categories inline-flex justify-center items-center"
15
+ class="post-category inline-flex-center"
16
16
  >
17
- <div m="x-1" i-ri-folder-2-line />
18
- {{ Array.isArray(categories) ? categories.join(' > ') : categories }}
17
+ <div m="x-1" inline-flex i-ri-folder-2-line />
18
+ <span>
19
+ {{ Array.isArray(categories) ? categories.join(' > ') : categories }}
20
+ </span>
19
21
  </router-link>
20
22
  </template>
@@ -15,8 +15,16 @@ const site = useSiteStore()
15
15
  const siteConfig = useSiteConfig()
16
16
  const pageSize = computed(() => siteConfig.value.pageSize)
17
17
 
18
- const posts = computed(() => props.posts || site.postList)
19
- const displayedPosts = computed(() => posts.value.slice((props.curPage - 1) * pageSize.value, props.curPage * pageSize.value))
18
+ const posts = computed(() => (
19
+ props.posts || site.postList).filter(post => import.meta.env.DEV ? true : !post.hide),
20
+ )
21
+
22
+ const displayedPosts = computed(() =>
23
+ posts.value.slice(
24
+ (props.curPage - 1) * pageSize.value,
25
+ props.curPage * pageSize.value,
26
+ ),
27
+ )
20
28
  </script>
21
29
 
22
30
  <template>
@@ -40,8 +48,4 @@ const displayedPosts = computed(() => posts.value.slice((props.curPage - 1) * pa
40
48
  border-top: 1px solid rgba(122, 122, 122, 0.15);
41
49
  min-height: 2.5rem;
42
50
  }
43
-
44
- .post-categories {
45
- color: var(--va-c-text);
46
- }
47
51
  </style>
@@ -12,6 +12,6 @@ defineProps<{
12
12
  class="post-tag inline-flex-center"
13
13
  >
14
14
  <div m="r-1" i-ri-price-tag-3-line />
15
- {{ tag }}
15
+ <span>{{ tag }}</span>
16
16
  </router-link>
17
17
  </template>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.14.14",
3
+ "version": "0.14.16",
4
4
  "author": {
5
5
  "email": "me@yunyoujun.cn",
6
6
  "name": "YunYouJun",
@@ -18,10 +18,10 @@
18
18
  "types": "types/index.d.ts",
19
19
  "dependencies": {
20
20
  "@iconify-json/ant-design": "^1.1.5",
21
- "@iconify-json/simple-icons": "^1.1.44",
21
+ "@iconify-json/simple-icons": "^1.1.45",
22
22
  "valaxy-addon-waline": "0.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "valaxy": "0.14.14"
25
+ "valaxy": "0.14.16"
26
26
  }
27
27
  }
@@ -91,6 +91,11 @@
91
91
  }
92
92
  }
93
93
 
94
+ // category
95
+ .post-category {
96
+ color: var(--va-c-text);
97
+ }
98
+
94
99
  .post-tag {
95
100
  white-space: nowrap;
96
101
  color: var(--yun-tag-color);
package/utils/index.ts CHANGED
@@ -1,5 +1,11 @@
1
1
  export const anonymousImage = 'https://cdn.yunyoujun.cn/img/avatar/none.jpg'
2
2
 
3
- export const onImgError = (e: Event) => {
4
- (e.target as HTMLImageElement).src = anonymousImage
3
+ /**
4
+ * set default img
5
+ * @param e
6
+ */
7
+ export const onImgError = (e: Event, defaultImg = anonymousImage) => {
8
+ const targetEl = e.target as HTMLImageElement
9
+ targetEl.setAttribute('data-src', targetEl.src)
10
+ targetEl.src = defaultImg
5
11
  }