valaxy-theme-yun 0.14.15 → 0.14.17

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.
@@ -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>
@@ -1,6 +1,6 @@
1
1
  <script lang="ts" setup>
2
2
  import type { Post } from 'valaxy'
3
- import { formatDate } from 'valaxy'
3
+ import { formatDate, useSiteConfig } from 'valaxy'
4
4
  import { useI18n } from 'vue-i18n'
5
5
 
6
6
  defineProps<{
@@ -9,6 +9,8 @@ defineProps<{
9
9
  }>()
10
10
 
11
11
  const { t } = useI18n()
12
+
13
+ const siteConfig = useSiteConfig()
12
14
  </script>
13
15
 
14
16
  <template>
@@ -23,7 +25,10 @@ const { t } = useI18n()
23
25
  <div i-ri-pushpin-line />
24
26
  </div>
25
27
 
26
- <div v-if="frontmatter" class="post-meta justify-center" flex="~" text="sm" py="1">
28
+ <div
29
+ v-if="frontmatter" class="post-meta"
30
+ flex="~ col" justify="center" items="center" text="sm" py="1"
31
+ >
27
32
  <div v-if="frontmatter.date" class="post-time flex items-center">
28
33
  <span class="inline-flex-center" :title="t('post.posted')">
29
34
  <div class="inline-block" i-ri-calendar-line />
@@ -39,6 +44,28 @@ const { t } = useI18n()
39
44
  <time m="l-1">{{ formatDate(frontmatter.updated) }}</time>
40
45
  </span>
41
46
  </div>
47
+
48
+ <div
49
+ v-if="siteConfig.statistics.enable"
50
+ class="post-counter flex items-center" mt="2"
51
+ >
52
+ <span
53
+ v-if="frontmatter.wordCount"
54
+ class="inline-flex-center" :title="t('statistics.word')"
55
+ >
56
+ <div class="inline-block" i-ri-file-word-line />
57
+ <time m="l-1">{{ frontmatter.wordCount }}</time>
58
+ </span>
59
+
60
+ <span
61
+ v-if="frontmatter.readingTime"
62
+ class="inline-flex-center" :title="t('statistics.time')"
63
+ >
64
+ <span m="x-2">-</span>
65
+ <div i-ri-timer-line />
66
+ <time m="l-1">{{ frontmatter.readingTime }}m</time>
67
+ </span>
68
+ </div>
42
69
  </div>
43
70
 
44
71
  <slot />
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "valaxy-theme-yun",
3
- "version": "0.14.15",
3
+ "version": "0.14.17",
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.46",
22
22
  "valaxy-addon-waline": "0.1.0"
23
23
  },
24
24
  "devDependencies": {
25
- "valaxy": "0.14.15"
25
+ "valaxy": "0.14.17"
26
26
  }
27
27
  }