Skip to content

Commit 2afdb8b

Browse files
committed
update docs
1 parent de40dae commit 2afdb8b

File tree

6 files changed

+90
-12
lines changed

6 files changed

+90
-12
lines changed
Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<script setup lang="ts">
2+
import { computed } from 'vue'
3+
import { VPLink } from 'vuepress-theme-plume/client'
4+
import { useRouteLocale } from 'vuepress/client'
5+
6+
interface Locale {
7+
star: string
8+
issue: string
9+
sponsor: string
10+
}
11+
12+
</script>
13+
14+
<template>
15+
<div class="aside-nav-wrapper">
16+
<VPLink class="link" no-icon href="https://github.com/fastapi-practices/fastapi_best_architecture">
17+
<span class="vpi-github-star" />
18+
<span class="link-text">在 GitHub 上 Star</span>
19+
<span class="vpi-arrow-right" />
20+
</VPLink>
21+
<VPLink class="link" no-icon href="/questions.html">
22+
<span class="vpi-github-issue" />
23+
<span class="link-text">遇到问题?</span>
24+
<span class="vpi-arrow-right" />
25+
</VPLink>
26+
</div>
27+
</template>
28+
29+
<style scoped>
30+
.aside-nav-wrapper {
31+
display: flex;
32+
flex-direction: column;
33+
padding: 8px 0;
34+
margin: 8px 8px 0;
35+
border-top: solid 1px var(--vp-c-divider);
36+
}
37+
38+
.aside-nav-wrapper .link {
39+
display: flex;
40+
gap: 8px;
41+
align-items: center;
42+
font-size: 14px;
43+
color: var(--vp-c-text-3);
44+
transition: color var(--vp-t-color);
45+
}
46+
47+
.aside-nav-wrapper .link:hover {
48+
color: var(--vp-c-brand-1);
49+
}
50+
51+
.aside-nav-wrapper .link .link-text {
52+
flex: 1 2;
53+
font-size: 12px;
54+
}
55+
56+
.vpi-github-star {
57+
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24'%3E%3Cpath fill='none' stroke='%23000' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='m12 1.5l3.1 6.3l6.9 1l-5 4.8l1.2 6.9l-6.2-3.2l-6.2 3.2L7 13.6L2 8.8l6.9-1z'/%3E%3C/svg%3E");
58+
}
59+
60+
.vpi-github-issue {
61+
--icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 16 16'%3E%3Cpath fill='%23000' d='M8 9.5a1.5 1.5 0 1 0 0-3a1.5 1.5 0 0 0 0 3'/%3E%3Cpath fill='%23000' d='M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0M1.5 8a6.5 6.5 0 1 0 13 0a6.5 6.5 0 0 0-13 0'/%3E%3C/svg%3E");
62+
}
63+
</style>

docs/.vuepress/components/SponsorPanel.vue

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,8 @@
22
<div class="sponsor-header" @click="toggleCollapse">
33
<span>倾情赞助</span>
44
<span class="toggle-icon">
5-
<Icon v-if="isCollapsed" name="iconamoon:arrow-right-2"/>
6-
<Icon v-else name="iconamoon:arrow-down-2"/>
5+
<Icon v-if="isCollapsed" name="iconamoon:arrow-right-2" />
6+
<Icon v-else name="iconamoon:arrow-down-2" />
77
</span>
88
</div>
99
<div class="sponsor-container" v-if="!isCollapsed">
@@ -33,18 +33,26 @@
3333
</template>
3434

3535
<script setup>
36-
import { ref } from "vue";
36+
import { ref, onMounted } from "vue";
3737
import { goldSponsors, generalSponsors } from "../data/sponsors";
3838
39-
const isCollapsed = ref(false);
39+
const isCollapsed = ref(sessionStorage.getItem("sponsorCollapsed") === "true");
4040
4141
const toggleCollapse = () => {
4242
isCollapsed.value = !isCollapsed.value;
43+
sessionStorage.setItem("sponsorCollapsed", isCollapsed.value);
4344
};
4445
4546
const openSponsorLink = (href) => {
4647
window.open(href, "_blank");
4748
};
49+
50+
onMounted(() => {
51+
const savedState = sessionStorage.getItem("sponsorCollapsed");
52+
if (savedState !== null) {
53+
isCollapsed.value = savedState === "true";
54+
}
55+
});
4856
</script>
4957

5058
<style scoped>

docs/.vuepress/data/sponsors.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export const homeSponsor = ref(
66
{
77
link: '',
88
text: '成为赞助商',
9-
href: '',
9+
href: sponsorUrl,
1010
alt: 'wu-clan',
1111
description: 'fba 官方合作伙伴',
1212
}

docs/.vuepress/layouts/Layout.vue

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,25 @@
11
<script setup>
22
import { Layout } from "vuepress-theme-plume/client";
33
import SponsorPanel from "../components/SponsorPanel.vue";
4+
import AsideNavAfter from "../components/AsideNavAfter.vue";
45
</script>
56

67
<template>
78
<Layout>
8-
<template #aside-outline-after>
9+
<template #layout-top>
910
<div class="custom-content">
10-
<SponsorPanel />
11+
<BannerTop />
1112
</div>
1213
</template>
1314
<template #sidebar-nav-before>
1415
<div class="custom-content">
1516
<SponsorSidebar />
1617
</div>
1718
</template>
18-
<template #layout-top>
19+
<template #aside-outline-after>
1920
<div class="custom-content">
20-
<BannerTop />
21+
<SponsorPanel />
22+
<AsideNavAfter />
2123
</div>
2224
</template>
2325
</Layout>

docs/questions.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
title: 常见问题
33
---
44

5+
::: tip
6+
如果以下解决方案未能帮助到您,请通过 [互动](./group.md) 与我们联系
7+
:::
8+
59
## Redis 缓存
610

711
由于缓存机制的特性,非接口操作对数据的更改可能无法实时反映到结果中。以下是两种常见场景:

docs/sponsors.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ fba 是一款基于 FastAPI 框架的后端架构解决方案,遵循伪三层
6666
<td>
6767
- 首页独家展示位<br>
6868
- 文档左侧边栏独家展示位<br>
69-
- 不可折叠<br>
69+
- 固定不可折叠<br>
7070
- 移动端可见
7171
</td>
7272
<td rowspan="2">
@@ -83,7 +83,7 @@ fba 是一款基于 FastAPI 框架的后端架构解决方案,遵循伪三层
8383
<td>
8484
- 首页信息展播展示位<br>
8585
- 文档右侧边栏大号展示位<br>
86-
- 不可折叠
86+
- 可折叠
8787
</td>
8888
</tr>
8989
<tr>
@@ -92,7 +92,8 @@ fba 是一款基于 FastAPI 框架的后端架构解决方案,遵循伪三层
9292
<td>联系作者</td>
9393
<td>
9494
- 首页滚动展示位<br>
95-
- 文档右侧边栏小号展示位
95+
- 文档右侧边栏小号展示位<br>
96+
- 可折叠
9697
</td>
9798
<td>
9899
- 赞助商名称<br>

0 commit comments

Comments
 (0)