Skip to content

Commit 3642a7a

Browse files
committed
update docs
1 parent 44a8f4e commit 3642a7a

File tree

6 files changed

+43
-56
lines changed

6 files changed

+43
-56
lines changed

docs/.vuepress/components/AsideNavAfter.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ interface Locale {
3131
display: flex;
3232
flex-direction: column;
3333
padding: 8px 0;
34-
margin: 8px 8px 0;
34+
margin: 6px 8px 0;
3535
border-top: solid 1px var(--vp-c-divider);
3636
}
3737

docs/.vuepress/components/SponsorHome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import { homeSponsor } from "../data/sponsors";
88
<a :href="homeSponsor.href" target="_blank">
99
<img width="121" :src="homeSponsor.link" :alt="homeSponsor.alt" />
1010
</a>
11-
<span>{{ homeSponsor.text || homeSponsor.alt }}</span>
11+
<span>fba 官方合作伙伴</span>
1212
</section>
1313
<section v-else id="special-spsr">
1414
<span class="no-sponsor">

docs/.vuepress/components/SponsorPanel.vue

Lines changed: 24 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,14 @@
1414
class="sponsor-item gold"
1515
:class="{ 'collapsed-mode': isCollapsed }"
1616
@click="openSponsorLink(sponsor.href)"
17-
v-show="!isCollapsed || (isCollapsed && hasValidText(sponsor))"
17+
v-show="!isCollapsed || (isCollapsed && !sponsor.alt.includes('成为赞助商'))"
1818
>
1919
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
20-
<span v-if="hasText(sponsor)" class="sponsor-text" :class="{ 'collapsed-text': isCollapsed }">
21-
{{ sponsor.text || sponsor.alt }}
20+
<span v-if="!isCollapsed && sponsor.alt.includes('成为赞助商')" class="sponsor-text">
21+
{{ sponsor.alt }}
22+
</span>
23+
<span v-if="isCollapsed" class="sponsor-text collapsed-text">
24+
{{ sponsor.alt }}
2225
</span>
2326
</div>
2427
</div>
@@ -29,32 +32,29 @@
2932
class="sponsor-item"
3033
:class="{ 'collapsed-mode': isCollapsed }"
3134
@click="openSponsorLink(sponsor.href)"
32-
v-show="!isCollapsed || (isCollapsed && hasValidText(sponsor))"
35+
v-show="!isCollapsed || (isCollapsed && !sponsor.alt.includes('成为赞助商'))"
3336
>
3437
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
35-
<span v-if="hasText(sponsor)" class="sponsor-text" :class="{ 'collapsed-text': isCollapsed }">
36-
{{ sponsor.text || sponsor.alt }}
38+
<span v-if="!isCollapsed && sponsor.alt.includes('成为赞助商')" class="sponsor-text">
39+
{{ sponsor.alt }}
40+
</span>
41+
<span v-if="isCollapsed" class="sponsor-text collapsed-text">
42+
{{ sponsor.alt }}
3743
</span>
3844
</div>
3945
</div>
46+
<div v-if="isCollapsed" class="sponsor-item become-sponsor" @click="openSponsorLink(sponsorUrl)">
47+
<span class="sponsor-text">成为赞助商</span>
48+
</div>
4049
</div>
4150
</template>
4251

4352
<script setup>
4453
import { ref, onMounted } from "vue";
45-
import { goldSponsors, generalSponsors } from "../data/sponsors";
54+
import { sponsorUrl, goldSponsors, generalSponsors } from "../data/sponsors";
4655
4756
const isCollapsed = ref(sessionStorage.getItem("sponsorCollapsed") === "true");
4857
49-
const hasText = (sponsor) => {
50-
return !!sponsor.text || !!sponsor.alt;
51-
};
52-
53-
const hasValidText = (sponsor) => {
54-
const text = sponsor.text || sponsor.alt || '';
55-
return hasText(sponsor) && !text.includes('成为赞助商');
56-
};
57-
5858
const toggleCollapse = () => {
5959
isCollapsed.value = !isCollapsed.value;
6060
sessionStorage.setItem("sponsorCollapsed", isCollapsed.value);
@@ -145,15 +145,11 @@ onMounted(() => {
145145
}
146146
147147
.sponsor-item.gold .sponsor-text {
148-
font-size: 12px;
148+
font-size: 13px;
149149
}
150150
151-
.sponsor-item.collapsed-mode {
152-
height: 28px;
153-
}
154-
155-
.sponsor-item.gold.collapsed-mode {
156-
height: 32px;
151+
.collapsed-mode {
152+
height: 32px !important;
157153
}
158154
159155
.collapsed-mode .sponsor-image {
@@ -169,4 +165,9 @@ onMounted(() => {
169165
.collapsed-mode:hover .collapsed-text {
170166
color: var(--vp-c-text-1) !important;
171167
}
168+
169+
.become-sponsor {
170+
height: 32px;
171+
background-color: unset;
172+
}
172173
</style>

docs/.vuepress/components/SponsorSidebar.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<div class="sidebar-sponsor">
77
<div class="sponsor" @click="openSponsorLink(homeSponsor.href)">
88
<img v-if="homeSponsor.link" :src="homeSponsor.link" :alt="homeSponsor.alt" class="sponsor-image" />
9-
<span v-else class="sponsor-text">{{ homeSponsor.text }}</span>
9+
<span v-else class="sponsor-text">成为赞助商</span>
1010
</div>
1111
</div>
1212
</div>
@@ -59,7 +59,7 @@ const openSponsorLink = (href) => {
5959
6060
.sponsor-text {
6161
color: var(--vp-c-text-3);
62-
font-size: 12px;
62+
font-size: 13px;
6363
}
6464
6565
@media (max-width: 576px) {

docs/.vuepress/components/Swiper.vue

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -31,10 +31,6 @@ interface SlideItem {
3131
* 图片地址
3232
*/
3333
link?: string;
34-
/**
35-
* 文字内容(当没有图片时使用)
36-
*/
37-
text?: string;
3834
/**
3935
* 跳转链接
4036
*/
@@ -189,17 +185,17 @@ onMounted(() => {
189185
>
190186
<img class="swiper-slide-custom-container swiper-slide-img" :src="item.link" :alt="item.alt" />
191187
</a>
192-
<div v-else-if="item.text" class="swiper-slide-custom-container">
188+
<div v-else-if="item.alt" class="swiper-slide-custom-container">
193189
<a
194190
v-if="item.href"
195191
:href="item.href"
196192
target="_blank"
197193
rel="noopener noreferrer"
198194
class="swiper-slide-text-link"
199195
>
200-
<div class="swiper-slide-text">{{ item.text }}</div>
196+
<div class="swiper-slide-text">{{ item.alt }}</div>
201197
</a>
202-
<div v-else class="swiper-slide-text">{{ item.text }}</div>
198+
<div v-else class="swiper-slide-text">{{ item.alt }}</div>
203199
</div>
204200
</SwiperSlide>
205201
</Swiper>

docs/.vuepress/data/sponsors.ts

Lines changed: 12 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,72 +1,62 @@
11
import { ref } from "vue";
22

3-
const sponsorUrl: string = typeof window !== 'undefined' ? window.location.origin + '/fastapi_best_architecture_docs/sponsors.html' : 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/sponsors.html';
3+
export const sponsorUrl: string = typeof window !== 'undefined' ? window.location.origin + '/fastapi_best_architecture_docs/sponsors.html' : 'https://fastapi-practices.github.io/fastapi_best_architecture_docs/sponsors.html';
44

55
export const homeSponsor = ref(
66
{
77
link: '',
8-
text: '成为赞助商',
98
href: sponsorUrl,
10-
alt: 'fba 官方合作伙伴'
9+
alt: '',
1110
}
1211
)
1312

1413
export const goldSponsors = ref([
1514
{
16-
link: '',
17-
text: '【腾讯云】春季大促,助力开工,2核2G云服务器低至 68元/年',
15+
link: 'https://dscache.tencent-cloud.cn/upload//rhino-design-800x450-fea2ea55b7b63624628bf9bb22454cb8f91b7d69.png',
1816
href: 'https://curl.qcloud.com/f9VMAii8',
19-
alt: '',
17+
alt: '2核2G云服务器低至 68元/年',
2018
},
2119
{
2220
link: 'https://img14.360buyimg.com/ddimg/jfs/t1/284966/5/22913/37242/68023351Faddd8304/6337ad52ea02ad10.jpg',
23-
text: '302.AI',
2421
href: 'https://share.302.ai/LJojhb',
25-
alt: '',
22+
alt: '302.AI',
2623
},
2724
{
2825
link: '',
29-
text: '成为赞助商',
3026
href: sponsorUrl,
31-
alt: '',
27+
alt: '成为赞助商',
3228
}
3329
])
3430

3531
export const generalSponsors = ref([
3632
{
3733
link: 'https://user.by.ltd/templates/lagom/assets/img/logo/logo_big.png',
38-
text: 'Bywave',
3934
href: 'https://user.by.ltd/aff.php?aff=12215',
40-
alt: '',
35+
alt: 'Bywave',
4136
},
4237
{
4338
link: '',
44-
text: '成为赞助商',
4539
href: sponsorUrl,
46-
alt: '',
40+
alt: '成为赞助商',
4741
},
4842
{
4943
link: '',
50-
text: '成为赞助商',
5144
href: sponsorUrl,
52-
alt: '',
45+
alt: '成为赞助商',
5346
},
5447
{
5548
link: '',
56-
text: '成为赞助商',
5749
href: sponsorUrl,
58-
alt: '',
50+
alt: '成为赞助商',
5951
},
6052
{
6153
link: '',
62-
text: '成为赞助商',
6354
href: sponsorUrl,
64-
alt: '',
55+
alt: '成为赞助商',
6556
},
6657
{
6758
link: '',
68-
text: '成为赞助商',
6959
href: sponsorUrl,
70-
alt: '',
60+
alt: '成为赞助商',
7161
}
7262
])

0 commit comments

Comments
 (0)