/
index.ts
145 lines (136 loc) · 3.06 KB
/
index.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
import type { ElButton } from 'element-plus'
import { DefaultTheme } from 'vitepress'
export namespace BlogPopover {
export interface Title {
type: 'title'
content: string
style?: string
}
export interface Text {
type: 'text'
content: string
style?: string
}
export interface Image {
type: 'image'
src: string
style?: string
}
export interface Button {
type: 'button'
link: string
content: string
style?: string
props?: InstanceType<typeof ElButton>['$props']
}
export type Value = Title | Text | Image | Button
}
export namespace Theme {
export interface PageMeta {
title: string
date: string
tag?: string[]
description?: string
cover?: string
sticky?: number
author?: string
hidden?: boolean
layout?: string
// old
categories: string[]
tags: string[]
}
export interface PageData {
route: string
meta: PageMeta
}
export interface activeTag {
label: string
type: string
}
export interface GiscusConfig {
repo: string
repoId: string
category: string
categoryId: string
mapping?: string
inputPosition?: 'top' | 'bottom'
lang?: string
loading?: 'lazy' | ''
}
export interface BlogConfig {
pagesData: PageData[]
author?: string
hotArticle?: {
title?: string
pageSize?: number
nextText?: string
empty?: string | boolean
}
home?: {
pageSize?: number
}
// TODO: 本地全文搜索定制 pagefind || minisearch
search?: boolean
/**
* 配置评论
* power by https://giscus.app/zh-CN
*/
comment?: GiscusConfig | false
recommend?: {
title?: string
pageSize?: number
nextText?: string
empty?: string | boolean
}
article?: {
readingTime?: boolean
}
/**
* el-alert
*/
alert?: {
type: 'success' | 'warning' | 'info' | 'error'
title?: string
description?: string
closable?: boolean
center?: boolean
closeText?: string
showIcon?: boolean
html?: string
/**
* 细粒度的时间控制
* 默认展示时间,-1 只展示1次,其它数字为每次都展示,一定时间后自动消失,0为不自动消失
* 配置改变时,会重新触发展示
*/
duration?: number
}
popover?: {
title: string
body?: BlogPopover.Value[]
footer?: BlogPopover.Value[]
/**
* 细粒度的时间控制
* 默认展示时间,-1 只展示1次,其它数字为每次都展示,一定时间后自动消失,0为不自动消失
* 配置改变时,会重新触发展示
*/
duration?: number
/**
* 手动重新打开
*/
reopen?: boolean
}
friend?: {
nickname: string
des: string
url: string
avatar: string
}[]
}
export interface Config extends DefaultTheme.Config {
blog: BlogConfig
}
export interface HomeConfig {
handleChangeSlogan?: (oldSlogan: string) => string | Promise<string>
}
}