Skip to content

Commit e3bc814

Browse files
committed
fix: wiki contributor list
- Filter out dependabot - Clean up styles a little - Fix name overflowing
1 parent 42c549c commit e3bc814

File tree

1 file changed

+39
-27
lines changed

1 file changed

+39
-27
lines changed

src/pages/wiki/index.astro

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ const getContributorLevel = (contributions: number) => {
3636
return "bronze";
3737
};
3838
39+
const filteredContributors = [
40+
49699333, // Dependabot
41+
];
42+
3943
const headers: HeadersInit = {};
4044
if (import.meta.env.GITHUB_TOKEN) {
4145
headers.Authorization = import.meta.env.GITHUB_TOKEN;
@@ -99,25 +103,31 @@ if (!contributors) {
99103
</p>
100104
<div class="flex">
101105
{
102-
contributors.map((user) => (
103-
<div
104-
class:list={[
105-
"contributor",
106-
getContributorLevel(user.contributions),
107-
]}
108-
>
109-
<a href={user.html_url} rel="noopener nofollow" target="_blank">
110-
<img src={user.avatar_url} />
111-
</a>
112-
<Tooltip
113-
content={user.login}
114-
placement="bottom"
115-
class="username"
106+
contributors
107+
.filter((user) => !filteredContributors.includes(user.id))
108+
.map((user) => (
109+
<div
110+
class:list={[
111+
"contributor",
112+
getContributorLevel(user.contributions),
113+
]}
116114
>
117-
<Fragment>{user.login}</Fragment>
118-
</Tooltip>
119-
</div>
120-
))
115+
<a
116+
href={user.html_url}
117+
rel="noopener nofollow"
118+
target="_blank"
119+
>
120+
<img src={user.avatar_url} />
121+
</a>
122+
<Tooltip
123+
content={user.login}
124+
placement="bottom"
125+
class="username"
126+
>
127+
<div>{user.login}</div>
128+
</Tooltip>
129+
</div>
130+
))
121131
}
122132
</div>
123133
</section>
@@ -200,18 +210,15 @@ if (!contributors) {
200210
}
201211

202212
div.contributor {
203-
width: 100%;
204213
height: auto;
205-
position: relative;
206-
width: 5em;
214+
width: 5.5em;
207215

208216
a,
209217
img {
210218
display: block;
211219
aspect-ratio: 1;
212220
width: 100%;
213221
border-radius: 99em;
214-
border-width: 0.2em;
215222
&:focus {
216223
outline: var(--tier-color) solid 0.3em;
217224
}
@@ -220,6 +227,7 @@ if (!contributors) {
220227
border-style: solid;
221228
box-sizing: border-box;
222229
box-shadow: var(--tier-color) 0px 0px 10px 2px;
230+
border-width: 0.2em;
223231
border-color: var(--tier-color);
224232
position: relative;
225233
}
@@ -237,14 +245,18 @@ if (!contributors) {
237245
--tier-color: #b46300;
238246
}
239247

240-
span.username {
248+
:global(span.username.tooltip) {
249+
margin-top: 0.2em;
241250
font-size: 0.9em;
242251
color: white;
243252
display: block;
244-
text-align: center;
245-
width: 100%;
246-
text-overflow: ellipsis;
247-
overflow: hidden;
253+
254+
& > div {
255+
font-weight: 300;
256+
text-align: center;
257+
text-overflow: ellipsis;
258+
overflow: hidden;
259+
}
248260
}
249261
}
250262
}

0 commit comments

Comments
 (0)