Skip to content

Commit 7698cf7

Browse files
committed
update docs
1 parent b99d30c commit 7698cf7

File tree

8 files changed

+593
-578
lines changed

8 files changed

+593
-578
lines changed

docs/.vuepress/components/SponsorHome.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<template>
2-
<section v-if="shouldShowSponsor(homeSponsor.expiryTime)" id="special-spsr">
2+
<section v-if="shouldShowSponsor(homeSponsor)" id="special-spsr">
33
<span>特别赞助商</span>
44
<a :href="homeSponsor.href" target="_blank">
55
<img :alt="homeSponsor.alt" :src="homeSponsor.link" width="208" />

docs/.vuepress/components/SponsorPanel.vue

Lines changed: 11 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,42 +9,34 @@
99
<div class="brand-container">
1010
<div class="gold-sponsors">
1111
<div
12-
v-for="(brand, index) in processedGoldSponsors"
13-
v-show="!isCollapsed || (isCollapsed && shouldShowSponsor(brand.expiryTime))"
14-
:key="'gold-' + index"
12+
v-for="brand in goldSponsors"
13+
v-show="shouldShowSponsor(brand)"
1514
:class="{ 'collapsed-mode': isCollapsed }"
1615
class="brand-item gold"
1716
@click="openSponsorLink(brand.href)"
1817
>
19-
<img v-if="!isCollapsed && brand.link" :alt="brand.alt" :src="brand.link" class="brand-image" />
20-
<span v-if="!isCollapsed && brand.alt.includes('成为赞助商')" class="brand-text">
21-
{{ brand.alt }}
22-
</span>
23-
<span v-if="isCollapsed" class="brand-text collapsed-text">
18+
<img v-if="!isCollapsed" :alt="brand.alt" :src="brand.link" class="brand-image" />
19+
<span v-else class="brand-text collapsed-text">
2420
{{ brand.alt }}
2521
</span>
2622
</div>
2723
</div>
2824
<div class="general-sponsors">
2925
<div
30-
v-for="(brand, index) in processedGeneralSponsors"
31-
v-show="!isCollapsed || (isCollapsed && shouldShowSponsor(brand.expiryTime))"
32-
:key="'general-' + index"
26+
v-for="brand in generalSponsors"
27+
v-show="shouldShowSponsor(brand)"
3328
:class="{ 'collapsed-mode': isCollapsed }"
3429
class="brand-item"
3530
@click="openSponsorLink(brand.href)"
3631
>
37-
<img v-if="!isCollapsed && brand.link" :alt="brand.alt" :src="brand.link" class="brand-image" />
38-
<span v-if="!isCollapsed && brand.alt.includes('成为赞助商')" class="brand-text">
39-
{{ brand.alt }}
40-
</span>
41-
<span v-if="isCollapsed" class="brand-text collapsed-text">
32+
<img v-if="!isCollapsed" :alt="brand.alt" :src="brand.link" class="brand-image" />
33+
<span v-else class="brand-text collapsed-text">
4234
{{ brand.alt }}
4335
</span>
4436
</div>
4537
</div>
4638
<div
47-
v-if="isCollapsed && shouldShowExtraBecomeSponsor"
39+
v-if="shouldShowExtraBecomeSponsor"
4840
class="brand-item become-brand"
4941
@click="openSponsorLink(sponsorUrl)"
5042
>
@@ -56,7 +48,6 @@
5648
<script setup>
5749
import { computed } from "vue";
5850
import {
59-
defaultSponsor,
6051
generalSponsors,
6152
goldSponsors,
6253
openSponsorLink,
@@ -67,21 +58,9 @@ import { useStorage } from "@vueuse/core";
6758
6859
const isCollapsed = useStorage('fba-docs-sponsor-collapsed', false);
6960
70-
const processedGoldSponsors = computed(() => {
71-
return goldSponsors.map(brand => {
72-
return shouldShowSponsor(brand.expiryTime) ? brand : defaultSponsor;
73-
});
74-
});
75-
76-
const processedGeneralSponsors = computed(() => {
77-
return generalSponsors.map(brand => {
78-
return shouldShowSponsor(brand.expiryTime) ? brand : defaultSponsor;
79-
});
80-
});
81-
8261
const shouldShowExtraBecomeSponsor = computed(() => {
83-
return (goldSponsors.filter(brand => brand.link && shouldShowSponsor(brand.expiryTime)).length +
84-
generalSponsors.filter(brand => brand.link && shouldShowSponsor(brand.expiryTime)).length) < 9;
62+
return (goldSponsors.filter(brand => shouldShowSponsor(brand)).length +
63+
generalSponsors.filter(brand => shouldShowSponsor(brand)).length) < 9;
8564
});
8665
8766
const toggleCollapse = () => {

docs/.vuepress/components/SponsorSidebar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
@click="openSponsorLink(homeSponsor.href)"
1010
>
1111
<img
12-
v-if="shouldShowSponsor(homeSponsor.expiryTime)"
12+
v-if="shouldShowSponsor(homeSponsor)"
1313
:alt="homeSponsor.alt"
1414
:src="homeSponsor.link"
1515
class="brand-image"

docs/.vuepress/components/Swiper.vue

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import "swiper/css/effect-flip";
2525
import "swiper/css/effect-coverflow";
2626
import "swiper/css/effect-cards";
2727
import "swiper/css/effect-creative";
28-
import { defaultSponsor, shouldShowSponsor, Sponsor } from "../data/sponsors";
28+
import { shouldShowSponsor, Sponsor } from "../data/sponsors";
2929
3030
interface Props {
3131
items?: Sponsor[];
@@ -54,12 +54,6 @@ const props = withDefaults(defineProps<Props>(), {
5454
swipe: true
5555
});
5656
57-
const sponsors = computed(() => {
58-
return props.items.map(brand => {
59-
return shouldShowSponsor(brand.expiryTime) ? brand : defaultSponsor;
60-
});
61-
});
62-
6357
function parseSize(size: number | string) {
6458
if (typeof size === "number") {
6559
return `${ size }px`;
@@ -161,28 +155,16 @@ onMounted(() => {
161155
v-bind="$attrs"
162156
@swiper="onSwiper"
163157
>
164-
<SwiperSlide v-for="(item, index) in sponsors" :key="'general-' + index">
158+
<SwiperSlide v-for="item in props.items">
165159
<a
166-
v-if="item.href && item.link"
160+
v-if="shouldShowSponsor(item)"
167161
:href="item.href"
168162
class="swiper-slide-link no-icon"
169163
rel="noopener noreferrer"
170164
target="_blank"
171165
>
172166
<img :alt="item.alt" :src="item.link" class="swiper-slide-custom-container swiper-slide-img" />
173167
</a>
174-
<div v-else-if="item.alt" class="swiper-slide-custom-container">
175-
<a
176-
v-if="item.href"
177-
:href="item.href"
178-
class="swiper-slide-text-link"
179-
rel="noopener noreferrer"
180-
target="_blank"
181-
>
182-
<div class="swiper-slide-text">{{ item.alt }}</div>
183-
</a>
184-
<div v-else class="swiper-slide-text">{{ item.alt }}</div>
185-
</div>
186168
</SwiperSlide>
187169
</Swiper>
188170
</ClientOnly>

docs/.vuepress/data/sponsors.ts

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,20 @@ export const defaultSponsor: Sponsor = {
1111
link: '',
1212
href: sponsorUrl,
1313
alt: '成为赞助商',
14-
expiryTime: '',
14+
expiryTime: '2099-12-31T23:59:59',
1515
};
1616

1717
export const homeSponsor: Sponsor = { ...defaultSponsor };
1818

1919

2020
export const goldSponsors: Sponsor[] = [
2121
{
22-
link: 'https://img14.360buyimg.com/ddimg/jfs/t1/284966/5/22913/37242/68023351Faddd8304/6337ad52ea02ad10.jpg',
23-
href: 'https://share.302.ai/LJojhb',
24-
alt: '302.AI',
25-
expiryTime: '2025-06-18T16:35:00',
26-
}
22+
link: '',
23+
href: 'https://www.serpshot.com',
24+
alt: 'Serpshot',
25+
expiryTime: '2099-12-31T23:59:59',
26+
},
27+
{ ...defaultSponsor }
2728
]
2829

2930
export const generalSponsors: Sponsor[] = [
@@ -40,10 +41,10 @@ export const openSponsorLink = (href: string) => {
4041
window.open(href);
4142
};
4243

43-
export function shouldShowSponsor(expiryTime?: string): boolean {
44-
if (expiryTime) {
44+
export function shouldShowSponsor(sponsor: Sponsor): boolean {
45+
if (!sponsor.alt.includes('成为赞助商') && sponsor.expiryTime) {
4546
const now = new Date();
46-
const expiryDate = new Date(expiryTime);
47+
const expiryDate = new Date(sponsor.expiryTime);
4748
return now < expiryDate;
4849
}
4950
return false;

docs/opensource.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,15 +7,15 @@ title: 开源项目
77
## 官方
88

99
<CardGrid>
10-
<RepoCard repo="fastapi-practices/fastapi_best_architecture" />
11-
<RepoCard repo="fastapi-practices/fastapi_best_architecture_ui" />
12-
<RepoCard repo="fastapi-practices/fast-captcha" />
13-
<RepoCard repo="fastapi-practices/sqlalchemy-crud-plus" />
14-
<RepoCard repo="fastapi-practices/fastapi-oauth20" />
15-
<RepoCard repo="fastapi-practices/fastapi_sqlalchemy_mysql" />
16-
<RepoCard repo="fastapi-practices/fastapi_tortoise_mysql" />
17-
<RepoCard repo="fastapi-practices/fastapi_scheduler" />
18-
<RepoCard repo="fastapi-practices/fastapi_best_architecture_ui_arco" />
10+
<RepoCard repo="fastapi-practices/fastapi_best_architecture" :fullname="false" />
11+
<RepoCard repo="fastapi-practices/fastapi_best_architecture_ui" :fullname="false" />
12+
<RepoCard repo="fastapi-practices/fast-captcha" :fullname="false" />
13+
<RepoCard repo="fastapi-practices/sqlalchemy-crud-plus" :fullname="false" />
14+
<RepoCard repo="fastapi-practices/fastapi-oauth20" :fullname="false" />
15+
<RepoCard repo="fastapi-practices/fastapi_sqlalchemy_mysql" :fullname="false" />
16+
<RepoCard repo="fastapi-practices/fastapi_tortoise_mysql" :fullname="false" />
17+
<RepoCard repo="fastapi-practices/fastapi_scheduler" :fullname="false" />
18+
<RepoCard repo="fastapi-practices/fastapi_best_architecture_ui_arco" :fullname="false" />
1919
</CardGrid>
2020

2121
## 第三方

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,12 @@
2323
"@vuepress/plugin-umami-analytics": "2.0.0-rc.112",
2424
"vue": "^3.5.18",
2525
"vuepress": "2.0.0-rc.24",
26-
"vuepress-theme-plume": "1.0.0-rc.160"
26+
"vuepress-theme-plume": "1.0.0-rc.161"
2727
},
2828
"dependencies": {
29-
"@iconify/json": "^2.2.366",
29+
"@iconify/json": "^2.2.376",
3030
"@vueuse/core": "^12.8.2",
31-
"mermaid": "^11.9.0",
31+
"mermaid": "^11.10.0",
3232
"swiper": "^11.2.10"
3333
}
3434
}

0 commit comments

Comments
 (0)