@sugarat/theme 0.4.10 → 0.4.11
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.d.ts +11 -1
- package/node.js +1 -1
- package/package.json +4 -3
- package/src/components/BlogItem.vue +1 -1
- package/src/components/BlogRecommendArticle.vue +31 -15
- package/src/composables/config/index.ts +11 -1
package/node.d.ts
CHANGED
|
@@ -175,6 +175,16 @@ declare namespace Theme {
|
|
|
175
175
|
* @default 'sidebar'
|
|
176
176
|
*/
|
|
177
177
|
style?: 'card' | 'sidebar';
|
|
178
|
+
/**
|
|
179
|
+
* 是否在左侧显示日期
|
|
180
|
+
* @default true
|
|
181
|
+
*/
|
|
182
|
+
showDate?: boolean;
|
|
183
|
+
/**
|
|
184
|
+
* 是否在左侧展示序号
|
|
185
|
+
* @default true
|
|
186
|
+
*/
|
|
187
|
+
showNum?: boolean;
|
|
178
188
|
}
|
|
179
189
|
interface HomeAnalysis {
|
|
180
190
|
articles?: {
|
|
@@ -516,7 +526,7 @@ declare namespace Theme {
|
|
|
516
526
|
* 周前
|
|
517
527
|
*/
|
|
518
528
|
weeksAgo?: string;
|
|
519
|
-
} | ((date: Date) => string);
|
|
529
|
+
} | ((date: Date | string) => string);
|
|
520
530
|
interface BackToTop {
|
|
521
531
|
/**
|
|
522
532
|
* 距离顶部多少距离出现
|
package/node.js
CHANGED
|
@@ -40,7 +40,7 @@ module.exports = __toCommonJS(node_exports);
|
|
|
40
40
|
// src/utils/node/mdPlugins.ts
|
|
41
41
|
var import_module = require("module");
|
|
42
42
|
|
|
43
|
-
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.3.
|
|
43
|
+
// ../../node_modules/.pnpm/vitepress-plugin-tabs@0.2.0_vitepress@1.3.4_@algolia+client-search@4.19.1_@types+node@20.6.3__ovjzvjgjmyeesvgttjdmi2b3dm/node_modules/vitepress-plugin-tabs/dist/index.js
|
|
44
44
|
var tabsMarker = "=tabs";
|
|
45
45
|
var tabsMarkerLen = tabsMarker.length;
|
|
46
46
|
var ruleBlockTabs = (state, startLine, endLine, silent) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sugarat/theme",
|
|
3
|
-
"version": "0.4.
|
|
3
|
+
"version": "0.4.11",
|
|
4
4
|
"description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
|
|
5
5
|
"author": "sugar",
|
|
6
6
|
"license": "MIT",
|
|
@@ -62,8 +62,9 @@
|
|
|
62
62
|
"sass": "^1.77.8",
|
|
63
63
|
"typescript": "^5.4.5",
|
|
64
64
|
"vite": "^5.2.11",
|
|
65
|
-
"vitepress": "1.3.
|
|
66
|
-
"vue": "^3.4.26"
|
|
65
|
+
"vitepress": "1.3.4",
|
|
66
|
+
"vue": "^3.4.26",
|
|
67
|
+
"vitepress-plugin-51la": "0.1.0"
|
|
67
68
|
},
|
|
68
69
|
"scripts": {
|
|
69
70
|
"dev": "npm run build:node && npm run dev:docs",
|
|
@@ -21,6 +21,10 @@ const recommendPadding = computed(() =>
|
|
|
21
21
|
const recommend = computed(() =>
|
|
22
22
|
_recommend === false ? undefined : _recommend
|
|
23
23
|
)
|
|
24
|
+
|
|
25
|
+
const showDate = computed(() => (_recommend && _recommend?.showDate) ?? true)
|
|
26
|
+
const showNum = computed(() => (_recommend && _recommend?.showNum) ?? true)
|
|
27
|
+
|
|
24
28
|
const title = computed(() => recommend.value?.title ?? (`<span class="svg-icon">${recommendSVG}</span>` + '相关文章'))
|
|
25
29
|
const pageSize = computed(() => recommend.value?.pageSize || 9)
|
|
26
30
|
const nextText = computed(() => recommend.value?.nextText || '换一组')
|
|
@@ -169,10 +173,16 @@ function handleLinkClick(link: string) {
|
|
|
169
173
|
</ElButton>
|
|
170
174
|
</div>
|
|
171
175
|
<!-- 文章列表 -->
|
|
172
|
-
<ol
|
|
173
|
-
|
|
176
|
+
<ol
|
|
177
|
+
v-if="currentWikiData.length" :class="{
|
|
178
|
+
'hide-num': !showNum,
|
|
179
|
+
}" class="recommend-container"
|
|
180
|
+
>
|
|
181
|
+
<li
|
|
182
|
+
v-for="(v, idx) in currentWikiData" :key="v.route"
|
|
183
|
+
>
|
|
174
184
|
<!-- 序号 -->
|
|
175
|
-
<i class="num">{{ startIdx + idx + 1 }}</i>
|
|
185
|
+
<i v-if="showNum" class="num">{{ startIdx + idx + 1 }}</i>
|
|
176
186
|
<!-- 简介 -->
|
|
177
187
|
<div class="des">
|
|
178
188
|
<!-- title -->
|
|
@@ -189,7 +199,7 @@ function handleLinkClick(link: string) {
|
|
|
189
199
|
<span>{{ v.meta.title }}</span>
|
|
190
200
|
</a>
|
|
191
201
|
<!-- 描述信息 -->
|
|
192
|
-
<div class="suffix">
|
|
202
|
+
<div v-if="showDate" class="suffix">
|
|
193
203
|
<!-- 日期 -->
|
|
194
204
|
<span class="tag">{{ formatShowDate(v.meta.date) }}</span>
|
|
195
205
|
</div>
|
|
@@ -234,6 +244,9 @@ function handleLinkClick(link: string) {
|
|
|
234
244
|
padding: 0 10px 0 0px;
|
|
235
245
|
width: 100%;
|
|
236
246
|
|
|
247
|
+
&.hide-num>li{
|
|
248
|
+
padding: 5px 0;
|
|
249
|
+
}
|
|
237
250
|
li {
|
|
238
251
|
display: flex;
|
|
239
252
|
|
|
@@ -253,6 +266,9 @@ function handleLinkClick(link: string) {
|
|
|
253
266
|
overflow: hidden;
|
|
254
267
|
text-overflow: ellipsis;
|
|
255
268
|
white-space: nowrap;
|
|
269
|
+
display: flex;
|
|
270
|
+
flex-direction: column;
|
|
271
|
+
justify-content: center;
|
|
256
272
|
}
|
|
257
273
|
|
|
258
274
|
.title {
|
|
@@ -263,21 +279,21 @@ function handleLinkClick(link: string) {
|
|
|
263
279
|
font-weight: 500;
|
|
264
280
|
position: relative;
|
|
265
281
|
cursor: pointer;
|
|
266
|
-
|
|
267
|
-
&.current {
|
|
282
|
+
transition: color .25s;
|
|
283
|
+
&.current,&:hover {
|
|
268
284
|
color: var(--vp-c-brand-1);
|
|
269
285
|
}
|
|
270
286
|
}
|
|
271
287
|
|
|
272
|
-
.title:hover::after {
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
}
|
|
288
|
+
// .title:hover::after {
|
|
289
|
+
// content: "";
|
|
290
|
+
// position: absolute;
|
|
291
|
+
// left: 0;
|
|
292
|
+
// right: 0;
|
|
293
|
+
// height: 0;
|
|
294
|
+
// bottom: -3px;
|
|
295
|
+
// border-bottom: 1px solid #b1b3b8;
|
|
296
|
+
// }
|
|
281
297
|
|
|
282
298
|
.suffix {
|
|
283
299
|
font-size: 12px;
|
|
@@ -184,6 +184,16 @@ export namespace Theme {
|
|
|
184
184
|
* @default 'sidebar'
|
|
185
185
|
*/
|
|
186
186
|
style?: 'card' | 'sidebar'
|
|
187
|
+
/**
|
|
188
|
+
* 是否在左侧显示日期
|
|
189
|
+
* @default true
|
|
190
|
+
*/
|
|
191
|
+
showDate?: boolean
|
|
192
|
+
/**
|
|
193
|
+
* 是否在左侧展示序号
|
|
194
|
+
* @default true
|
|
195
|
+
*/
|
|
196
|
+
showNum?: boolean
|
|
187
197
|
}
|
|
188
198
|
|
|
189
199
|
export interface HomeAnalysis {
|
|
@@ -552,7 +562,7 @@ export namespace Theme {
|
|
|
552
562
|
* 周前
|
|
553
563
|
*/
|
|
554
564
|
weeksAgo?: string
|
|
555
|
-
} | ((date: Date) => string)
|
|
565
|
+
} | ((date: Date | string) => string)
|
|
556
566
|
export interface BackToTop {
|
|
557
567
|
/**
|
|
558
568
|
* 距离顶部多少距离出现
|