Skip to content

Commit ed98857

Browse files
authored
docs: credit JetBrains for the open source licenses (#2984)
1 parent 4bcc01f commit ed98857

8 files changed

Lines changed: 206 additions & 2 deletions

File tree

README.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,22 @@
4444
<img src="website/src/public/img/cloudsmith.svg" height="100px" width="200px" title="Cloudsmith" />
4545
</a>
4646
</td>
47+
<td align="center" valign="middle">
48+
<a target="_blank" href="https://jb.gg/OpenSource">
49+
<picture>
50+
<source media="(prefers-color-scheme: dark)" srcset="website/src/public/img/jetbrains-dark.svg" />
51+
<img src="website/src/public/img/jetbrains.svg" height="100px" width="200px" title="JetBrains" alt="JetBrains logo" />
52+
</picture>
53+
</a>
54+
</td>
55+
</tr>
56+
<tr>
57+
<td align="center">
58+
Package hosting provided by <a target="_blank" href="https://cloudsmith.com/">Cloudsmith</a>.
59+
</td>
60+
<td align="center">
61+
Tooling provided by <a target="_blank" href="https://jb.gg/OpenSource">JetBrains</a>.
62+
</td>
4763
</tr>
4864
</table>
4965
</div>
Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
<script setup lang="ts">
2+
import { ref } from 'vue';
3+
import { useSponsorsGrid } from 'vitepress/dist/client/theme-default/composables/sponsor-grid';
4+
import type { Sponsor } from '../sponsors';
5+
6+
interface Props {
7+
size?: 'xmini' | 'mini' | 'small' | 'medium' | 'big';
8+
data: Sponsor[];
9+
}
10+
11+
const props = withDefaults(defineProps<Props>(), {
12+
size: 'medium'
13+
});
14+
15+
const el = ref(null);
16+
17+
useSponsorsGrid({ el, size: props.size });
18+
</script>
19+
20+
<template>
21+
<div class="VPSponsorsGrid vp-sponsor-grid" :class="[size]" ref="el">
22+
<div
23+
v-for="sponsor in data"
24+
:key="sponsor.name"
25+
class="vp-sponsor-grid-item"
26+
:class="{ 'has-dark-logo': sponsor.imgDark }"
27+
>
28+
<a
29+
class="vp-sponsor-grid-link"
30+
:href="sponsor.url"
31+
target="_blank"
32+
rel="sponsored noopener"
33+
>
34+
<article class="vp-sponsor-grid-box">
35+
<h4 class="visually-hidden">{{ sponsor.name }}</h4>
36+
<!-- Both logos are rendered and one is hidden in CSS, so the right
37+
one is already in place before hydration. -->
38+
<img
39+
class="vp-sponsor-grid-image logo-light"
40+
:src="sponsor.img"
41+
:alt="sponsor.name"
42+
/>
43+
<img
44+
v-if="sponsor.imgDark"
45+
class="vp-sponsor-grid-image logo-dark"
46+
:src="sponsor.imgDark"
47+
:alt="sponsor.name"
48+
/>
49+
</article>
50+
</a>
51+
<!-- Sits inside the tile: the grid clips anything that overflows it. -->
52+
<span v-if="sponsor.description" class="tooltip">
53+
{{ sponsor.description }}
54+
</span>
55+
</div>
56+
</div>
57+
</template>
58+
59+
<style scoped>
60+
.vp-sponsor-grid-item {
61+
position: relative;
62+
}
63+
64+
.tooltip {
65+
position: absolute;
66+
bottom: 14px;
67+
left: 50%;
68+
transform: translate(-50%, 6px);
69+
max-width: calc(100% - 28px);
70+
padding: 7px 12px;
71+
border: 1px solid var(--vp-c-divider);
72+
border-radius: 10px;
73+
background-color: var(--vp-c-bg-elv);
74+
box-shadow: var(--vp-shadow-2);
75+
color: var(--vp-c-text-1);
76+
font-size: 13px;
77+
font-weight: 500;
78+
line-height: 18px;
79+
text-align: center;
80+
text-wrap: balance;
81+
opacity: 0;
82+
transition:
83+
opacity 0.2s,
84+
transform 0.2s;
85+
pointer-events: none;
86+
}
87+
88+
.vp-sponsor-grid-item:hover .tooltip,
89+
.vp-sponsor-grid-item:focus-within .tooltip {
90+
opacity: 1;
91+
transform: translate(-50%, 0);
92+
}
93+
94+
@media (prefers-reduced-motion: reduce) {
95+
.tooltip {
96+
transition: none;
97+
}
98+
}
99+
</style>

website/.vitepress/config.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -316,6 +316,12 @@ export default defineConfig({
316316
replacement: fileURLToPath(
317317
new URL('./components/VPTeamMembersItem.vue', import.meta.url)
318318
)
319+
},
320+
{
321+
find: /^.*\/VPSponsorsGrid\.vue$/,
322+
replacement: fileURLToPath(
323+
new URL('./components/VPSponsorsGrid.vue', import.meta.url)
324+
)
319325
}
320326
]
321327
}

website/.vitepress/sponsors.ts

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
1-
export const sponsors = [
1+
export interface Sponsor {
2+
name: string;
3+
url: string;
4+
img: string;
5+
// Logo variant for dark backgrounds. Sponsors that set one keep their own
6+
// colours instead of being inverted by the sponsor grid.
7+
imgDark?: string;
8+
// Tooltip explaining what this sponsor gives the project.
9+
description?: string;
10+
}
11+
12+
export const sponsors: { tier: string; size: string; items: Sponsor[] }[] = [
213
{
314
tier: 'Gold Sponsors',
415
size: 'big',
@@ -27,7 +38,16 @@ export const sponsors = [
2738
{
2839
name: 'Cloudsmith',
2940
url: 'https://cloudsmith.com/',
30-
img: '/img/cloudsmith.svg'
41+
img: '/img/cloudsmith.svg',
42+
description: 'Hosts the deb and rpm package registries for free'
43+
},
44+
{
45+
name: 'JetBrains',
46+
url: 'https://jb.gg/OpenSource',
47+
img: '/img/jetbrains.svg',
48+
imgDark: '/img/jetbrains-mono.svg',
49+
description:
50+
'Provides free All Products Pack licenses to the maintainers'
3151
}
3252
]
3353
}

website/.vitepress/theme/custom.css

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,3 +145,27 @@ img[src*='custom-icon-badges.demolab.com'] {
145145
.VPTeamPage > .VPTeamPageTitle {
146146
padding-top: 0
147147
}
148+
149+
/* VitePress greys out sponsor logos by default. Show them in their brand
150+
colours in light mode; dark mode keeps the inversion so black wordmarks
151+
stay readable. */
152+
html:not(.dark) .vp-sponsor-grid-image {
153+
filter: none;
154+
}
155+
156+
/* A sponsor shipping its own dark-background logo already reads correctly on
157+
dark, so it opts out of the grid's invert treatment. On hover the grid turns
158+
the tile white, so it falls back to the light logo like every other tile. */
159+
.vp-sponsor-grid-item.has-dark-logo .vp-sponsor-grid-image {
160+
filter: none;
161+
}
162+
163+
.dark .vp-sponsor-grid-item.has-dark-logo .logo-light,
164+
.dark .vp-sponsor-grid-item.has-dark-logo:hover .logo-dark,
165+
html:not(.dark) .vp-sponsor-grid-item .logo-dark {
166+
display: none;
167+
}
168+
169+
.dark .vp-sponsor-grid-item.has-dark-logo:hover .logo-light {
170+
display: block;
171+
}
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading
Lines changed: 13 additions & 0 deletions
Loading

0 commit comments

Comments
 (0)