@sugarat/theme 0.1.26 → 0.1.28

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/node.js CHANGED
@@ -106,7 +106,9 @@ function getThemeConfig(cfg) {
106
106
  new Date(`${new Date(meta.date).toUTCString()}+8`)
107
107
  );
108
108
  }
109
- meta.tag = (meta.tag || []).concat([
109
+ meta.categories = typeof meta.categories === "string" ? [meta.categories] : meta.categories;
110
+ meta.tags = typeof meta.tags === "string" ? [meta.tags] : meta.tags;
111
+ meta.tag = [meta.tag || []].flat().concat([
110
112
  .../* @__PURE__ */ new Set([...meta.categories || [], ...meta.tags || []])
111
113
  ]);
112
114
  const wordCount = 100;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarat/theme",
3
- "version": "0.1.26",
3
+ "version": "0.1.28",
4
4
  "description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -41,12 +41,12 @@
41
41
  "vue-command-palette": "^0.1.4"
42
42
  },
43
43
  "devDependencies": {
44
- "@element-plus/icons-vue": "^2.0.10",
45
- "element-plus": "^2.2.28",
44
+ "@element-plus/icons-vue": "^2.1.0",
45
+ "element-plus": "^2.3.4",
46
46
  "sass": "^1.56.1",
47
47
  "tsup": " ^6.5.0",
48
48
  "typescript": "^4.8.2",
49
- "vitepress": "1.0.0-alpha.62",
49
+ "vitepress": "1.0.0-alpha.75",
50
50
  "vue": "^3.2.45"
51
51
  },
52
52
  "scripts": {
@@ -43,7 +43,9 @@ const { Layout } = Theme
43
43
  <BlogHomeBanner />
44
44
  </div>
45
45
  <div class="content-wrapper">
46
- <div class="blog-list-wrapper"><blog-list /></div>
46
+ <div class="blog-list-wrapper">
47
+ <BlogList />
48
+ </div>
47
49
  <div class="blog-info-wrapper"><BlogHomeInfo /></div>
48
50
  </div>
49
51
  </div>
@@ -13,16 +13,20 @@
13
13
  />
14
14
  </li>
15
15
  </ul>
16
- <el-pagination
17
- v-if="wikiList.length >= pageSize"
18
- small
19
- background
20
- :current-page="currentPage"
21
- @update:current-page="handleUpdatePageNum"
22
- :page-size="pageSize"
23
- :total="filterData.length"
24
- layout="prev, pager, next, jumper"
25
- />
16
+ <!-- 解决element-ui bug -->
17
+ <ClientOnly>
18
+ <el-pagination
19
+ v-if="wikiList.length >= pageSize"
20
+ small
21
+ background
22
+ :default-current-page="1"
23
+ :current-page="currentPage"
24
+ @update:current-page="handleUpdatePageNum"
25
+ :page-size="pageSize"
26
+ :total="filterData.length"
27
+ layout="prev, pager, next, jumper"
28
+ />
29
+ </ClientOnly>
26
30
  </template>
27
31
  <script setup lang="ts">
28
32
  import { computed, watch } from 'vue'
package/src/node.ts CHANGED
@@ -63,9 +63,16 @@ export function getThemeConfig(cfg?: Partial<Theme.BlogConfig>) {
63
63
  }
64
64
 
65
65
  // 处理tags和categories,兼容历史文章
66
- meta.tag = (meta.tag || []).concat([
67
- ...new Set([...(meta.categories || []), ...(meta.tags || [])])
68
- ])
66
+ meta.categories =
67
+ typeof meta.categories === 'string'
68
+ ? [meta.categories]
69
+ : meta.categories
70
+ meta.tags = typeof meta.tags === 'string' ? [meta.tags] : meta.tags
71
+ meta.tag = [meta.tag || []]
72
+ .flat()
73
+ .concat([
74
+ ...new Set([...(meta.categories || []), ...(meta.tags || [])])
75
+ ])
69
76
 
70
77
  // 获取摘要信息
71
78
  const wordCount = 100