Skip to content

Commit 2508cb8

Browse files
committed
update docs
1 parent d2da4c9 commit 2508cb8

File tree

8 files changed

+299
-149
lines changed

8 files changed

+299
-149
lines changed

docs/.vuepress/client.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,14 @@ import Layout from './layouts/Layout.vue'
55
import './styles/custom.css'
66
import Swiper from "./components/Swiper.vue";
77
import SponsorPanel from "./components/SponsorPanel.vue";
8+
import SponsorHome from './components/SponsorHome.vue';
89

910
export default defineClientConfig({
1011
enhance({ app }) {
1112
app.component('RepoCard', RepoCard)
1213
app.component('Swiper', Swiper)
1314
app.component('SponsorPanel', SponsorPanel)
15+
app.component('SponsorHome', SponsorHome)
1416
},
1517
layouts: {
1618
Layout,
Lines changed: 84 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,84 @@
1+
<script setup lang="ts">
2+
3+
import { homeSponsor } from "../data/sponsors";
4+
5+
</script>
6+
7+
<template>
8+
<section v-if="homeSponsor.href && homeSponsor.link" id="special-spsr">
9+
<span>特别赞助商</span>
10+
<a :href="homeSponsor.href" target="_blank">
11+
<img width="168" height="42" :src="homeSponsor.link" :alt="homeSponsor.alt" />
12+
</a>
13+
<span>{{ homeSponsor.text }}</span>
14+
</section>
15+
<section v-else id="special-spsr">
16+
<span>
17+
<a class="no-sponsor" href="/fastapi_best_architecture_docs/sponsors#展位赞助商">
18+
特别赞助位目前空缺 - 现在咨询
19+
</a>
20+
</span>
21+
</section>
22+
</template>
23+
24+
<style scoped>
25+
.no-sponsor{
26+
color: var(--vp-c-brand-1)
27+
}
28+
29+
.no-sponsor:hover {
30+
color: var(--vp-c-brand-2) !important;
31+
}
32+
33+
#special-spsr {
34+
border-top: 1px solid var(--vp-c-divider);
35+
border-bottom: 1px solid var(--vp-c-divider);
36+
padding: 12px 24px;
37+
display: flex;
38+
align-items: center;
39+
margin: 0 -9999px;
40+
padding: 1 9999px;
41+
}
42+
43+
#special-spsr span {
44+
color: var(--vp-c-text-2);
45+
font-weight: 500;
46+
font-size: 13px;
47+
vertical-align: middle;
48+
flex: 1;
49+
}
50+
51+
#special-spsr span:first-child {
52+
text-align: right;
53+
}
54+
55+
#special-spsr a {
56+
display: flex;
57+
justify-content: center;
58+
padding: 0 24px;
59+
}
60+
61+
#special-spsr img {
62+
height: 42px;
63+
margin: -6px 0;
64+
}
65+
66+
.dark #special-spsr img {
67+
filter: grayscale(1) invert(1);
68+
}
69+
70+
@media (max-width: 576px) {
71+
#special-spsr {
72+
flex-direction: column;
73+
}
74+
75+
#special-spsr img {
76+
height: 36px;
77+
margin: 8px 0;
78+
}
79+
80+
#special-spsr span {
81+
text-align: center !important;
82+
}
83+
}
84+
</style>

docs/.vuepress/components/SponsorPanel.vue

Lines changed: 13 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -3,47 +3,37 @@
33
<!-- Gold Sponsors -->
44
<div class="gold-sponsors">
55
<div
6-
v-for="(sponsor, index) in goldSponsors"
7-
:key="'gold-' + index"
8-
class="sponsor-item gold"
9-
@click="openSponsorLink(sponsor.href)"
6+
v-for="(sponsor, index) in goldSponsors"
7+
:key="'gold-' + index"
8+
class="sponsor-item gold"
9+
@click="openSponsorLink(sponsor.href)"
1010
>
11-
<img
12-
v-if="sponsor.link"
13-
:src="sponsor.link"
14-
:alt="sponsor.alt"
15-
class="sponsor-image"
16-
/>
11+
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
1712
<span v-else class="sponsor-text">{{ sponsor.text }}</span>
1813
</div>
1914
</div>
2015

2116
<!-- General Sponsors -->
2217
<div class="general-sponsors">
2318
<div
24-
v-for="(sponsor, index) in generalSponsors"
25-
:key="'general-' + index"
26-
class="sponsor-item"
27-
@click="openSponsorLink(sponsor.href)"
19+
v-for="(sponsor, index) in generalSponsors"
20+
:key="'general-' + index"
21+
class="sponsor-item"
22+
@click="openSponsorLink(sponsor.href)"
2823
>
29-
<img
30-
v-if="sponsor.link"
31-
:src="sponsor.link"
32-
:alt="sponsor.alt"
33-
class="sponsor-image"
34-
/>
24+
<img v-if="sponsor.link" :src="sponsor.link" :alt="sponsor.alt" class="sponsor-image" />
3525
<span v-else class="sponsor-text">{{ sponsor.text }}</span>
3626
</div>
3727
</div>
3828
</div>
3929
</template>
4030

4131
<script setup>
42-
import {goldSponsors, generalSponsors} from "../data/sponsors";
32+
import { goldSponsors, generalSponsors } from "../data/sponsors";
4333
4434
const openSponsorLink = (href) => {
45-
window.open(href, '_blank')
46-
}
35+
window.open(href, "_blank");
36+
};
4737
</script>
4838

4939
<style scoped>

0 commit comments

Comments
 (0)