Skip to content

Commit 2e00be3

Browse files
Merge pull request #27 from pascalgrimaud/homepage-sponsors
Add sponsors
2 parents 3955a0e + e2f2d10 commit 2e00be3

File tree

8 files changed

+149
-7
lines changed

8 files changed

+149
-7
lines changed

.vitepress/config.mts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,11 +62,7 @@ export default defineConfig({
6262
url: 'https://seed4j.com',
6363
logo: 'https://seed4j.com/logo.png',
6464
name: 'Seed4J',
65-
sameAs: [
66-
'https://github.com/seed4j/seed4j',
67-
'https://www.linkedin.com/company/seed4j',
68-
'https://x.com/seed4j'
69-
]
65+
sameAs: ['https://github.com/seed4j/seed4j', 'https://www.linkedin.com/company/seed4j', 'https://x.com/seed4j'],
7066
}),
7167
],
7268
],
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
<script setup lang="ts">
2+
import { sponsors as staticSponsors } from '../../../sponsors/data';
3+
import { VPButton } from 'vitepress/theme';
4+
5+
type Sponsor = { name: string; url: string; logo: string | null };
6+
const sponsors: Record<'platinum' | 'gold' | 'silver' | 'bronze', Sponsor[]> = staticSponsors;
7+
8+
const titleMap: Record<string, string> = {
9+
platinum: 'Platinum',
10+
gold: 'Gold',
11+
silver: 'Silver',
12+
bronze: 'Bronze',
13+
};
14+
</script>
15+
16+
<template>
17+
<section id="sponsors" class="sponsors">
18+
<h2 class="sponsors__title">Sponsors</h2>
19+
<p class="sponsors__tagline">Seed4J is planted 🌱 by the community, grown with the support of amazing sponsors.</p>
20+
21+
<div v-for="(list, tier) in sponsors" :key="tier" class="sponsors__tier" :class="tier">
22+
<template v-if="Array.isArray(list) && list.length">
23+
<h3 class="sponsors__tier-title">{{ titleMap[tier] ?? tier }} sponsors</h3>
24+
<div class="sponsors__grid">
25+
<a v-for="s in list" :key="s.name" :href="s.url" target="_blank" rel="noopener" class="sponsors__card" :class="tier">
26+
<template v-if="s.logo">
27+
<img :src="s.logo" :alt="s.name" />
28+
</template>
29+
<template v-else>
30+
<div class="sponsors__name">{{ s.name }}</div>
31+
</template>
32+
</a>
33+
</div>
34+
</template>
35+
</div>
36+
37+
<div class="sponsors__tier backers">
38+
<h3 class="sponsors__tier-title">Backers</h3>
39+
<div class="sponsors__grid">
40+
<a href="https://opencollective.com/seed4j/" target="_blank" rel="noopener">
41+
<img src="https://opencollective.com/seed4j/tiers/backers.svg?button=false" alt="Backers" />
42+
</a>
43+
</div>
44+
</div>
45+
46+
<div class="sponsors__cta">
47+
<VPButton theme="alt" text="💚 Sponsor Seed4J" href="https://opencollective.com/seed4j" rel="noopener" target="_blank" />
48+
</div>
49+
</section>
50+
</template>
51+
52+
<style scoped>
53+
.sponsors {
54+
margin-top: 2rem;
55+
}
56+
.sponsors__title {
57+
font-size: 1.8rem;
58+
margin-bottom: 0.25rem;
59+
}
60+
.sponsors__tagline {
61+
opacity: 0.8;
62+
margin-bottom: 1rem;
63+
}
64+
65+
.sponsors__tier {
66+
margin-top: 1.5rem;
67+
}
68+
.sponsors__tier-title {
69+
font-size: 1.2rem;
70+
margin: 0.5rem 0;
71+
}
72+
.sponsors__grid {
73+
display: grid;
74+
gap: 16px;
75+
grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
76+
align-items: center;
77+
}
78+
79+
.sponsors__card img {
80+
max-width: 100%;
81+
width: auto;
82+
height: auto;
83+
object-fit: contain;
84+
}
85+
.sponsors__card.platinum img {
86+
max-height: 300px;
87+
}
88+
.sponsors__card.gold img {
89+
max-height: 150px;
90+
}
91+
.sponsors__card.silver img {
92+
max-height: 100px;
93+
}
94+
.sponsors__card.bronze img {
95+
max-height: 48px;
96+
}
97+
98+
.sponsors__card {
99+
background: var(--vp-c-bg-soft);
100+
border-radius: 12px;
101+
padding: 12px;
102+
display: flex;
103+
justify-content: center;
104+
align-items: center;
105+
transition: opacity 0.2s ease;
106+
}
107+
.sponsors__card:hover {
108+
opacity: 0.9;
109+
}
110+
111+
.sponsors__name {
112+
font-size: 1rem;
113+
font-weight: bold;
114+
text-align: center;
115+
padding: 12px;
116+
color: var(--vp-c-text);
117+
}
118+
119+
.sponsors__cta {
120+
margin-top: 1.5rem;
121+
display: flex;
122+
justify-content: center;
123+
}
124+
125+
.sponsors__cta :deep(a) {
126+
text-decoration: none !important;
127+
}
128+
</style>

.vitepress/theme/index.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import type { Theme } from 'vitepress';
33
import DefaultTheme from 'vitepress/theme';
44
import { h } from 'vue';
5+
import Sponsors from './components/Sponsors.vue';
56
import './style.css';
67

78
export default {
@@ -12,6 +13,6 @@ export default {
1213
});
1314
},
1415
enhanceApp({ app, router, siteData }) {
15-
// ...
16+
app.component('Sponsors', Sponsors);
1617
},
1718
} satisfies Theme;

index.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,3 +42,5 @@ features:
4242
title: Open Source & Community-Driven
4343
details: Fully open source, welcoming contributions and ideas to grow together.
4444
---
45+
46+
<Sponsors />

package-lock.json

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

sponsors/data.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// sponsors/data.ts
2+
export type Sponsor = { name: string; url: string; logo: string };
3+
4+
export const sponsors: Record<'platinum' | 'gold' | 'silver' | 'bronze', Sponsor[]> = {
5+
platinum: [],
6+
gold: [],
7+
silver: [],
8+
bronze: [
9+
{
10+
name: 'Geoffray Gruel',
11+
url: 'https://www.linkedin.com/in/ggruel/',
12+
logo: 'https://avatars.githubusercontent.com/u/996402?v=4'
13+
},
14+
],
15+
};

sponsors/logos/blank.png

1.62 KB
Loading

sponsors/logos/seed4j.png

37.4 KB
Loading

0 commit comments

Comments
 (0)