@sugarat/theme 0.1.31 → 0.1.32

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
@@ -68,6 +68,7 @@ declare namespace Theme {
68
68
  * 专栏&合集
69
69
  */
70
70
  album: string;
71
+ publish?: boolean;
71
72
  }
72
73
  interface PageData {
73
74
  route: string;
package/node.js CHANGED
@@ -279,6 +279,10 @@ function getThemeConfig(cfg) {
279
279
  const wordCount = 100;
280
280
  meta.description = meta.description || getTextSummary(fileContent, wordCount);
281
281
  meta.cover = meta.cover || fileContent.match(/[!]\[.*?\]\((https:\/\/.+)\)/)?.[1] || "";
282
+ if (meta.publish === false) {
283
+ meta.hidden = true;
284
+ meta.recommend = false;
285
+ }
282
286
  return {
283
287
  route: `/${route}`,
284
288
  meta
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sugarat/theme",
3
- "version": "0.1.31",
3
+ "version": "0.1.32",
4
4
  "description": "简约风的 Vitepress 博客主题,sugarat vitepress blog theme",
5
5
  "main": "src/index.ts",
6
6
  "exports": {
@@ -51,7 +51,7 @@ const activeTag = useActiveTag()
51
51
  const activeTagLabel = computed(() => activeTag.value.label)
52
52
 
53
53
  const wikiList = computed(() => {
54
- const topList = docs.value.filter((v) => !!v.meta.top)
54
+ const topList = docs.value.filter((v) => !v.meta.hidden && !!v.meta.top)
55
55
  topList.sort((a, b) => {
56
56
  const aTop = a?.meta?.top
57
57
  const bTop = b?.meta.top
@@ -70,6 +70,8 @@ export namespace Theme {
70
70
  * 专栏&合集
71
71
  */
72
72
  album: string
73
+ // 是否发布
74
+ publish?: boolean
73
75
  }
74
76
  export interface PageData {
75
77
  route: string
package/src/node.ts CHANGED
@@ -48,6 +48,7 @@ export function getThemeConfig(cfg?: Partial<Theme.BlogConfig>) {
48
48
  const meta: Partial<Theme.PageMeta> = {
49
49
  ...matter(fileContent).data
50
50
  }
51
+
51
52
  if (!meta.title) {
52
53
  meta.title = getDefaultTitle(fileContent)
53
54
  }
@@ -85,6 +86,13 @@ export function getThemeConfig(cfg?: Partial<Theme.BlogConfig>) {
85
86
  meta.cover ||
86
87
  fileContent.match(/[!]\[.*?\]\((https:\/\/.+)\)/)?.[1] ||
87
88
  ''
89
+
90
+ // 是否发布 默认发布
91
+ if (meta.publish === false) {
92
+ meta.hidden = true
93
+ meta.recommend = false
94
+ }
95
+
88
96
  return {
89
97
  route: `/${route}`,
90
98
  meta
@@ -103,3 +103,24 @@ html[class='dark'] {
103
103
  word-break: break-all;
104
104
  }
105
105
  }
106
+
107
+ ::-webkit-scrollbar {
108
+ width: 5px;
109
+ height: 5px;
110
+ }
111
+
112
+ ::-webkit-scrollbar-track-piece {
113
+ background-color: rgba(0, 0, 0, 0);
114
+ }
115
+
116
+ ::-webkit-scrollbar-thumb:vertical {
117
+ height: 5px;
118
+ border-radius: 4px;
119
+ background-color: var(--el-color-primary);
120
+ }
121
+
122
+ ::-webkit-scrollbar-thumb:horizontal {
123
+ width: 5px;
124
+ border-radius: 4px;
125
+ background-color: var(--el-color-primary);
126
+ }