Skip to content

Commit cb87846

Browse files
committed
update docs
1 parent 0aa1677 commit cb87846

File tree

3 files changed

+103
-81
lines changed

3 files changed

+103
-81
lines changed

docs/.vuepress/components/PluginMarket.vue

+85-70
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,12 @@
1717
<div v-else class="image-placeholder">
1818
<Icon :name="item.icon" size="3em" color="var(--vp-c-brand)" />
1919
</div>
20+
<div v-if="item.priceLabel" class="price-corner-tag">
21+
<span class="price-corner-text">{{ item.priceLabel }}</span>
22+
</div>
2023
</div>
2124
<div class="card-content">
22-
<h3 class="card-title">{{ item.title }}</h3>
23-
<p class="card-description">{{ item.description }}</p>
24-
<div class="card-tags">
25-
<span
26-
v-for="(tag, tagIndex) in item.tags"
27-
:key="tagIndex"
28-
class="badge"
29-
:style="getTagColors(tag)"
30-
>{{ tag }}</span>
31-
</div>
32-
<div class="card-footer">
25+
<div class="card-header">
3326
<div class="item-developer-info">
3427
<img
3528
:src="getGithubAvatarUrl(item.githubUser)"
@@ -40,25 +33,36 @@
4033
{{ item.githubUser }}
4134
</span>
4235
</div>
43-
<div v-if="!item.link" class="built-in-label">内置</div>
4436
<a
45-
v-else
37+
v-if="item.link"
4638
:href="item.link"
4739
class="github-link no-external-icon"
4840
target="_blank"
4941
rel="noopener noreferrer"
5042
aria-label="GitHub仓库"
5143
@click.stop
5244
>
53-
<Icon name="mdi:github" size="1.5em" color="var(--vp-c-text-2)" />
45+
<Icon name="mdi:github" size="1.1em" color="var(--vp-c-text-2)" />
5446
</a>
47+
<span v-else class="built-in-label-inline">内置</span>
48+
</div>
49+
<h3 class="card-title">{{ item.title }}</h3>
50+
<p class="card-description">{{ item.description }}</p>
51+
<div class="card-tags">
52+
<span
53+
v-for="(tag, tagIndex) in item.tags"
54+
:key="tagIndex"
55+
class="badge"
56+
:style="getTagColors(tag)"
57+
>{{ tag }}</span>
5558
</div>
5659
</div>
5760
</div>
5861
</div>
5962
</template>
6063

6164
<script setup lang="ts">
65+
import type { CSSProperties } from 'vue';
6266
6367
export interface PluginItem {
6468
icon: string
@@ -68,6 +72,7 @@ export interface PluginItem {
6872
link?: string
6973
image?: string
7074
githubUser: string
75+
priceLabel?: '免费' | '付费'
7176
}
7277
7378
const props = withDefaults(
@@ -80,32 +85,31 @@ const props = withDefaults(
8085
}
8186
)
8287
83-
interface TagColors {
84-
color?: string
85-
backgroundColor?: string
86-
borderColor?: string
88+
interface TagColors extends CSSProperties {
8789
}
8890
8991
const getTagColors = (tag: string): TagColors => {
9092
const colors: Record<string, TagColors> = {
9193
'MySQL': { color: '#006484', backgroundColor: 'rgba(0, 100, 132, 0.1)', borderColor: 'rgba(0, 100, 132, 0.2)' },
92-
'PostgreSQL': { color: '#336699', backgroundColor: 'rgba(51, 102, 153, 0.1)', borderColor: 'rgba(51, 102, 153, 0.2)' },
94+
'PostgreSQL': {
95+
color: '#336699',
96+
backgroundColor: 'rgba(51, 102, 153, 0.1)',
97+
borderColor: 'rgba(51, 102, 153, 0.2)'
98+
},
9399
'fba': { color: '#8b5cf6', backgroundColor: 'rgba(139, 92, 246, 0.1)', borderColor: 'rgba(139, 92, 246, 0.2)' },
94100
'fba_ui': { color: '#a855f7', backgroundColor: 'rgba(168, 85, 247, 0.1)', borderColor: 'rgba(168, 85, 247, 0.2)' },
95101
'app': { color: '#f97316', backgroundColor: 'rgba(249, 115, 22, 0.1)', borderColor: 'rgba(249, 115, 22, 0.2)' },
96102
'extra': { color: '#64748b', backgroundColor: 'rgba(100, 116, 139, 0.1)', borderColor: 'rgba(100, 116, 139, 0.2)' },
97-
'pay': { color: '#ef4444', backgroundColor: 'rgba(239, 68, 68, 0.1)', borderColor: 'rgba(239, 68, 68, 0.2)' },
98-
'free': { color: '#10b981', backgroundColor: 'rgba(16, 185, 129, 0.1)', borderColor: 'rgba(16, 185, 129, 0.2)' }
99103
};
100104
return colors[tag] || {
101105
color: 'var(--vp-c-text-2)',
102106
backgroundColor: 'var(--vp-c-bg-soft)',
103-
borderColor: 'var(--vp-c-divider-light)'
107+
borderColor: 'var(--vp-c-divider)'
104108
};
105109
}
106110
107111
const getGithubAvatarUrl = (username: string) => {
108-
return `https://github.com/${username}.png?size=32`;
112+
return `https://github.com/${ username }.png?size=32`;
109113
};
110114
111115
const handleCardClick = (item: PluginItem) => {
@@ -183,51 +187,13 @@ const handleCardClick = (item: PluginItem) => {
183187
flex-grow: 1;
184188
display: flex;
185189
flex-direction: column;
186-
justify-content: space-between;
187-
}
188-
189-
.card-title {
190-
font-size: 1rem;
191-
font-weight: 600;
192-
color: var(--vp-c-text-1);
193-
margin: 0 0 0.4rem 0;
194-
line-height: 1.4;
195-
}
196-
197-
.card-description {
198-
color: var(--vp-c-text-2);
199-
font-size: 0.85rem;
200-
line-height: 1.5;
201-
margin: 0 0 0.8rem 0;
202-
flex-grow: 1;
203-
}
204-
205-
.card-tags {
206-
display: flex;
207-
flex-wrap: wrap;
208-
align-items: center;
209-
gap: 0.4rem;
210-
margin-bottom: 0.8rem;
211-
}
212-
213-
.badge {
214-
display: inline-flex;
215-
align-items: center;
216-
justify-content: center;
217-
padding: 0.1rem 0.5rem;
218-
border-radius: 4px;
219-
font-size: 0.75rem;
220-
line-height: 1;
221-
font-weight: 500;
222-
white-space: nowrap;
223-
border: 1px solid transparent;
224190
}
225191
226-
.card-footer {
192+
.card-header {
227193
display: flex;
228194
justify-content: space-between;
229195
align-items: center;
230-
gap: 0.5rem;
196+
margin-bottom: 0.8rem; /* Space below the header */
231197
}
232198
233199
.item-developer-info {
@@ -256,25 +222,74 @@ const handleCardClick = (item: PluginItem) => {
256222
}
257223
258224
.github-link {
259-
transition: all 0.2s ease;
260-
pointer-events: none;
225+
color: var(--vp-c-text-2);
226+
transition: color 0.2s ease;
227+
pointer-events: auto; /* Allow clicks on the icon */
228+
flex-shrink: 0;
229+
display: inline-flex;
230+
align-items: center;
231+
margin-left: 0.5rem; /* Space between developer info and icon */
232+
}
233+
234+
.github-link:hover {
235+
color: var(--vp-c-brand);
261236
}
262237
263238
.no-external-icon::after {
264239
content: none !important;
265240
}
266241
267-
.built-in-label {
268-
font-size: 0.85rem;
242+
.built-in-label-inline {
243+
font-size: 0.75rem;
269244
color: var(--vp-c-text-2);
270-
padding: 0;
271-
border-radius: 0;
245+
padding: 0.1rem 0.4rem;
246+
border-radius: 4px;
247+
border: 1px solid var(--vp-c-divider);
248+
background-color: var(--vp-c-bg-soft);
272249
flex-shrink: 0;
273-
margin-left: auto;
250+
margin-left: 0.5rem; /* Space between developer info and label */
274251
white-space: nowrap;
275252
font-weight: 500;
276253
}
277254
255+
256+
.card-title {
257+
font-size: 1rem;
258+
font-weight: 600;
259+
color: var(--vp-c-text-1);
260+
margin: 0 0 0.4rem 0;
261+
line-height: 1.4;
262+
}
263+
264+
.card-description {
265+
color: var(--vp-c-text-2);
266+
font-size: 0.85rem;
267+
line-height: 1.5;
268+
margin: 0 0 0.8rem 0;
269+
flex-grow: 1;
270+
}
271+
272+
.card-tags {
273+
display: flex;
274+
flex-wrap: wrap;
275+
align-items: center;
276+
gap: 0.4rem;
277+
margin-top: auto;
278+
}
279+
280+
.badge {
281+
display: inline-flex;
282+
align-items: center;
283+
justify-content: center;
284+
padding: 0.1rem 0.5rem;
285+
border-radius: 4px;
286+
font-size: 0.75rem;
287+
line-height: 1;
288+
font-weight: 500;
289+
white-space: nowrap;
290+
border: 1px solid transparent;
291+
}
292+
278293
@media (min-width: 768px) {
279294
.plugin-card-container {
280295
grid-template-columns: repeat(2, 1fr);

docs/.vuepress/data/plugin.ts

+18-9
Original file line numberDiff line numberDiff line change
@@ -6,28 +6,32 @@ export const pluginItems: PluginItem[] = [
66
title: "代码生成",
77
description: "生成通用业务代码(仅后端工程)",
88
tags: ["MySQL", "PostgreSQL", "fba", "app"],
9-
githubUser: 'wu-clan'
9+
githubUser: 'wu-clan',
10+
priceLabel: "免费"
1011
},
1112
{
1213
icon: "fe:notice-active",
1314
title: "通知公告",
1415
description: "发布系统内部通知、公告",
1516
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
16-
githubUser: 'wu-clan'
17+
githubUser: 'wu-clan',
18+
priceLabel: "免费"
1719
},
1820
{
1921
icon: "fluent-mdl2:dictionary",
2022
title: "数据字典",
2123
description: "通常用于约束前端工程数据展示",
2224
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
23-
githubUser: 'wu-clan'
25+
githubUser: 'wu-clan',
26+
priceLabel: "免费"
2427
},
2528
{
2629
icon: "icon-park-outline:config",
2730
title: "参数配置",
2831
description: "通常用于前端工程数据展示",
2932
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
30-
githubUser: 'wu-clan'
33+
githubUser: 'wu-clan',
34+
priceLabel: "免费"
3135
},
3236
{
3337
icon: "charm:shield-keyhole",
@@ -36,7 +40,8 @@ export const pluginItems: PluginItem[] = [
3640
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
3741
link: "https://github.com/fastapi-practices/fba_casbin",
3842
image: "https://avatars.githubusercontent.com/u/27810343?s=200&v=4",
39-
githubUser: 'wu-clan'
43+
githubUser: 'wu-clan',
44+
priceLabel: "免费"
4045
},
4146
{
4247
icon: "streamline:ai-prompt-spark",
@@ -45,7 +50,8 @@ export const pluginItems: PluginItem[] = [
4550
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
4651
link: "https://github.com/fastapi-practices/fba_mcp",
4752
image: "https://github.com/modelcontextprotocol/.github/raw/main/profile/assets/light.png",
48-
githubUser: 'wu-clan'
53+
githubUser: 'wu-clan',
54+
priceLabel: "免费"
4955
},
5056
{
5157
icon: "ant-design:aliyun-outlined",
@@ -54,15 +60,17 @@ export const pluginItems: PluginItem[] = [
5460
tags: ["MySQL", "PostgreSQL", "fba", "extra"],
5561
link: "https://github.com/fastapi-practices/fba_aliyun_oss",
5662
image: "https://img.alicdn.com/tfs/TB1Ly5oS3HqK1RjSZFPXXcwapXa-238-54.png",
57-
githubUser: 'wu-clan'
63+
githubUser: 'wu-clan',
64+
priceLabel: "免费"
5865
},
5966
{
6067
icon: "material-symbols:token-outline",
6168
title: "配置下发",
6269
description: "将 env 等配置信息通过数据库进行管理",
6370
tags: ["MySQL", "fba", "extra"],
6471
link: "https://github.com/dividduang/option",
65-
githubUser: 'dividduang'
72+
githubUser: 'dividduang',
73+
priceLabel: "免费"
6674
},
6775
{
6876
icon: "ant-design:wechat-work-outlined",
@@ -71,6 +79,7 @@ export const pluginItems: PluginItem[] = [
7179
tags: ["MySQL", "fba", "extra"],
7280
link: "https://github.com/dividduang/wecom-task",
7381
image: "https://rescdn.qqmail.com/node/wework/images/Slice.d2258f37eb.png",
74-
githubUser: 'dividduang'
82+
githubUser: 'dividduang',
83+
priceLabel: "免费"
7584
}
7685
]

docs/plugin/market.md

-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ aside: false
55

66
::: info 标签说明
77

8-
<Badge text="pay" color="#ef4444" bg-color="rgba(239, 68, 68, 0.1)" border-color="rgba(239, 68, 68, 0.2)" /> [+pay] |
98
<Badge text="MySQL" color="#006484" bg-color="rgba(0, 100, 132, 0.1)" border-color="rgba(0, 100, 132, 0.2)" /> [+MySQL] |
109
<Badge text="PostgreSQL" color="#336699" bg-color="rgba(51, 102, 153, 0.1)" border-color="rgba(51, 102, 153, 0.2)" /> [+PostgreSQL] |
1110
<Badge text="fba" color="#8b5cf6" bg-color="rgba(139, 92, 246, 0.1)" border-color="rgba(139, 92, 246, 0.2)" /> [+fba] |
@@ -15,7 +14,6 @@ aside: false
1514

1615
:::
1716

18-
[+pay]: 付费插件
1917
[+MySQL]: 支持 MySQL
2018
[+PostgreSQL]: 支持 PostgreSQL
2119
[+fba]: 仅后端代码插件

0 commit comments

Comments
 (0)