Skip to content

Commit 325aa5d

Browse files
authored
chore: auto sync sponsors (#1481)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Added an automated Sponsors sync workflow (scheduled + manual) to refresh sponsor listings and update READMEs. * Added a package script to run the sponsors sync and apply formatting. * **Documentation** * Replaced single sponsor badges with multi-tier sponsor galleries (Platinum, Gold, Silver, Generous, Sponsors, Backers, Past Sponsors). * Centralized sponsor data for consistent theme rendering and static display across docs. * **Chores** * Removed several outdated redirect mappings. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent 62c9665 commit 325aa5d

File tree

56 files changed

+6866
-271
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+6866
-271
lines changed
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Sponsors Sync
2+
3+
on:
4+
schedule:
5+
- cron: '0 1 * * *'
6+
workflow_dispatch:
7+
8+
jobs:
9+
sync:
10+
runs-on: ubuntu-latest
11+
permissions:
12+
contents: write
13+
steps:
14+
- uses: actions/checkout@v4
15+
with:
16+
ref: main
17+
18+
- uses: pnpm/action-setup@v4
19+
20+
- run: pnpm env use --global 22
21+
22+
- run: pnpm i
23+
24+
- run: pnpm sponsors:sync
25+
26+
- uses: EndBug/add-and-commit@v9
27+
with:
28+
author_name: GitHub Actions
29+
author_email: 41898282+github-actions[bot]@users.noreply.github.com
30+
message: 'chore: sync sponsors'
31+
env:
32+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

README.md

Lines changed: 116 additions & 4 deletions
Large diffs are not rendered by default.

apps/content/.vitepress/theme/components/AsideSponsors.vue

Lines changed: 8 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,26 @@
11
<script lang="ts" setup>
2-
import { useElementVisibility } from '@vueuse/core'
3-
import { computed, ref } from 'vue'
4-
import { useSponsors } from '../composables/sponsors.ts'
2+
import { sponsors } from '../sponsors'
53
6-
const container = ref<HTMLDivElement>()
7-
const containerIsVisible = useElementVisibility(container)
8-
9-
const { sponsors } = useSponsors(containerIsVisible)
10-
11-
const normalSponsors = computed(() => sponsors.value.filter(s => s.rightSidebarSize === 'normal'))
12-
const smallSponsors = computed(() => sponsors.value.filter(s => s.rightSidebarSize === 'small'))
4+
const normalSponsors = sponsors.filter(s => s.sidebarSize === 'normal')
5+
const smallSponsors = sponsors.filter(s => s.sidebarSize === 'small')
136
</script>
147

158
<template>
16-
<div ref="container" class="aside-container">
9+
<div class="aside-container">
1710
<a class="aside-sponsors-title" href="https://github.com/sponsors/dinwwwh" target="_blank" rel="noopener">SPONSORS</a>
1811

1912
<div class="aside-sponsors-list">
20-
<a v-for="sponsor in normalSponsors" :key="sponsor.login" class="aside-sponsor" target="_blank" :href="sponsor.rightSidebarLink">
21-
<img :src="sponsor.rightSidebarLogo" :alt="sponsor.name">
13+
<a v-for="sponsor in normalSponsors" :key="sponsor.login" class="aside-sponsor" target="_blank" :href="sponsor.link">
14+
<img :src="sponsor.sidebarLogo" :alt="sponsor.name || sponsor.login">
2215
</a>
2316

2417
<a v-if="normalSponsors.length < 3" class="aside-sponsor" href="https://github.com/sponsors/dinwwwh" target="_blank" rel="noopener">
2518
<span class="aside-sponsor-text">Become a sponsor</span>
2619
</a>
2720

2821
<div class="aside-sponsors-small">
29-
<a v-for="sponsor in smallSponsors" :key="sponsor.login" class="aside-sponsor" target="_blank" :href="sponsor.rightSidebarLink">
30-
<img :src="sponsor.rightSidebarLogo" :alt="sponsor.name">
22+
<a v-for="sponsor in smallSponsors" :key="sponsor.login" class="aside-sponsor" target="_blank" :href="sponsor.link">
23+
<img :src="sponsor.sidebarLogo" :alt="sponsor.name || sponsor.login">
3124
</a>
3225
</div>
3326
</div>
Lines changed: 169 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,111 @@
1+
<script lang="ts" setup>
2+
import { computed } from 'vue'
3+
import { sponsors } from '../sponsors'
4+
5+
const activeSponsors = computed(() =>
6+
sponsors.filter(s => s.tierLevel > 0 && s.amount > 0),
7+
)
8+
9+
const pastSponsors = computed(() =>
10+
sponsors.filter(s => s.tierLevel <= 0 || s.amount <= 0),
11+
)
12+
13+
const tierGroups = computed(() => {
14+
const grouped = new Map<number, typeof sponsors>()
15+
16+
for (const sponsor of activeSponsors.value) {
17+
const group = grouped.get(sponsor.tierLevel)
18+
if (group) {
19+
group.push(sponsor)
20+
}
21+
else {
22+
grouped.set(sponsor.tierLevel, [sponsor])
23+
}
24+
}
25+
26+
const tierLevels = [...grouped.keys()].sort((a, b) => b - a)
27+
28+
return tierLevels.map((level) => {
29+
const tierSponsors = grouped.get(level)!
30+
const rank = tierLevels.indexOf(level)
31+
const sizes = [220, 170, 120, 88, 76, 54]
32+
const imageSize = sizes[Math.min(rank, sizes.length - 1)] ?? 100
33+
34+
return {
35+
level,
36+
title: tierSponsors[0]?.tierTitle ?? `Tier ${level}`,
37+
sponsors: tierSponsors,
38+
imageSize,
39+
}
40+
})
41+
})
42+
</script>
43+
144
<template>
245
<div class="full-sponsors-container">
346
<h2 class="sponsored-by">
447
Sponsored by
548
</h2>
49+
<p class="sponsor-cta">
50+
If you find oRPC valuable and would like to support its development:
51+
<a href="https://github.com/sponsors/dinwwwh" target="_blank" rel="noopener noreferrer">GitHub Sponsors</a>
52+
</p>
53+
54+
<div v-for="tier in tierGroups" :key="tier.level" class="tier-section">
55+
<h3 class="tier-title">
56+
{{ tier.title }}
57+
</h3>
58+
<table class="tier-table">
59+
<tr v-for="(row, rowIndex) in Math.ceil(tier.sponsors.length / 6)" :key="rowIndex">
60+
<td
61+
v-for="sponsor in tier.sponsors.slice(rowIndex * 6, rowIndex * 6 + 6)"
62+
:key="sponsor.login"
63+
align="center"
64+
>
65+
<a
66+
:href="sponsor.link"
67+
target="_blank"
68+
rel="sponsored noopener noreferrer"
69+
:title="sponsor.name || sponsor.login"
70+
class="sponsor-link"
71+
>
72+
<img
73+
:src="sponsor.avatar"
74+
:alt="sponsor.name || sponsor.login"
75+
:width="tier.imageSize"
76+
loading="lazy"
77+
>
78+
<br>
79+
<span class="sponsor-name">{{ sponsor.name || sponsor.login }}</span>
80+
</a>
81+
</td>
82+
</tr>
83+
</table>
84+
</div>
685

7-
<div class="full-sponsors">
8-
<a href="https://cdn.jsdelivr.net/gh/dinwwwh/dinwwwh/sponsors.svg" target="_blank" rel="noopener noreferrer">
9-
<img
10-
crossorigin="anonymous"
11-
inline-block
12-
width="768" height="1464"
13-
class="resizable-img"
14-
loading="lazy"
15-
src="https://cdn.jsdelivr.net/gh/dinwwwh/dinwwwh/sponsors.svg"
16-
alt="dinwwwh's sponsors"
86+
<div v-if="pastSponsors.length > 0" class="tier-section">
87+
<h3 class="tier-title">
88+
Past Sponsors
89+
</h3>
90+
<p class="past-sponsors">
91+
<a
92+
v-for="sponsor in pastSponsors"
93+
:key="sponsor.login"
94+
:href="sponsor.link"
95+
target="_blank"
96+
rel="sponsored noopener noreferrer"
97+
:title="sponsor.name || sponsor.login"
1798
>
18-
</a>
99+
<img
100+
:src="sponsor.avatar"
101+
:alt="sponsor.name || sponsor.login"
102+
width="32"
103+
height="32"
104+
class="past-sponsor-avatar"
105+
loading="lazy"
106+
>
107+
</a>
108+
</p>
19109
</div>
20110
</div>
21111
</template>
@@ -27,19 +117,84 @@
27117
justify-content: center;
28118
align-items: center;
29119
flex-direction: column;
120+
max-width: 768px;
121+
margin-left: auto;
122+
margin-right: auto;
30123
}
31124
32125
.sponsored-by {
33126
opacity: 0.8;
34-
margin: 48px 0 16px;
127+
margin: 48px 0 8px;
35128
border-top: 1px solid var(--vp-c-divider);
36129
padding-top: 24px;
37130
letter-spacing: -0.02em;
38131
line-height: 32px;
39132
font-size: 24px;
40133
}
41134
42-
.full-sponsors {
43-
margin-top: 24px;
135+
.sponsor-cta {
136+
margin-bottom: 24px;
137+
font-size: 14px;
138+
color: var(--vp-c-text-2);
139+
}
140+
141+
.sponsor-cta a {
142+
color: var(--vp-c-brand-1);
143+
text-decoration: underline;
144+
}
145+
146+
.tier-section {
147+
width: 100%;
148+
margin-bottom: 16px;
149+
}
150+
151+
.tier-title {
152+
font-size: 18px;
153+
font-weight: 600;
154+
margin-bottom: 8px;
155+
color: var(--vp-c-text-1);
156+
}
157+
158+
.tier-table {
159+
border-collapse: collapse;
160+
margin-left: auto;
161+
margin-right: auto;
162+
}
163+
164+
.tier-table td {
165+
padding: 12px;
166+
vertical-align: top;
167+
text-align: center;
168+
}
169+
170+
.sponsor-link {
171+
text-decoration: none;
172+
display: inline-flex;
173+
flex-direction: column;
174+
align-items: center;
175+
}
176+
177+
.sponsor-link:hover {
178+
opacity: 0.8;
179+
}
180+
181+
.sponsor-name {
182+
font-size: 13px;
183+
color: var(--vp-c-text-2);
184+
}
185+
186+
.past-sponsors {
187+
display: flex;
188+
flex-wrap: wrap;
189+
gap: 8px;
190+
}
191+
192+
.past-sponsor-avatar {
193+
opacity: 0.7;
194+
transition: opacity 0.2s;
195+
}
196+
197+
.past-sponsor-avatar:hover {
198+
opacity: 1;
44199
}
45200
</style>

apps/content/.vitepress/theme/composables/sponsors.ts

Lines changed: 0 additions & 46 deletions
This file was deleted.

0 commit comments

Comments
 (0)