@sugarat/theme 0.1.8 → 0.1.9
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
CHANGED
package/package.json
CHANGED
|
@@ -66,9 +66,16 @@ const recommendList = computed(() => {
|
|
|
66
66
|
.filter((v) => !!v.meta.title)
|
|
67
67
|
// 过滤掉自己
|
|
68
68
|
.filter((v) => v.route !== route.path.replace(/.html$/, ''))
|
|
69
|
+
// 过滤掉不需要展示的
|
|
70
|
+
.filter((v) => v.meta.recommend !== false)
|
|
69
71
|
|
|
70
|
-
origin.
|
|
71
|
-
|
|
72
|
+
const topList = origin.filter((v) => v.meta?.recommend)
|
|
73
|
+
topList.sort((a, b) => Number(a.meta.recommend) - Number(b.meta.recommend))
|
|
74
|
+
|
|
75
|
+
const normalList = origin.filter((v) => !v.meta?.recommend)
|
|
76
|
+
normalList.sort((a, b) => +new Date(b.meta.date) - +new Date(a.meta.date))
|
|
77
|
+
|
|
78
|
+
return topList.concat(normalList)
|
|
72
79
|
})
|
|
73
80
|
const currentPage = ref(1)
|
|
74
81
|
const changePage = () => {
|
|
@@ -128,7 +135,7 @@ const showChangeBtn = computed(() => {
|
|
|
128
135
|
font-size: 14px;
|
|
129
136
|
color: var(--description-font-color);
|
|
130
137
|
font-weight: 600;
|
|
131
|
-
margin: 6px
|
|
138
|
+
margin: 6px 8px 10px 0;
|
|
132
139
|
width: 18px;
|
|
133
140
|
height: 18px;
|
|
134
141
|
line-height: 18px;
|
package/src/index.ts
CHANGED
|
@@ -10,9 +10,15 @@ import DefaultTheme from 'vitepress/theme'
|
|
|
10
10
|
import BlogApp from './components/BlogApp.vue'
|
|
11
11
|
import { withConfigProvider } from './composables/config/blog'
|
|
12
12
|
|
|
13
|
+
// page
|
|
14
|
+
import TimelinePage from './components/TimelinePage.vue'
|
|
15
|
+
|
|
13
16
|
export const BlogTheme: Theme = {
|
|
14
17
|
...DefaultTheme,
|
|
15
|
-
Layout: withConfigProvider(BlogApp)
|
|
18
|
+
Layout: withConfigProvider(BlogApp),
|
|
19
|
+
enhanceApp(ctx) {
|
|
20
|
+
ctx.app.component('TimelinePage', TimelinePage)
|
|
21
|
+
}
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export * from './composables/config/index'
|