Skip to content

Commit c89dd29

Browse files
authored
Add Bluesky profile link support (#3824)
1 parent c214a3b commit c89dd29

20 files changed

Lines changed: 83 additions & 20 deletions

File tree

src/config/contributors.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -584,6 +584,7 @@
584584
},
585585
"tunetheweb": {
586586
"avatar_url": "10931297",
587+
"bluesky": "tunetheweb.com",
587588
"github": "tunetheweb",
588589
"linkedin": "tunetheweb",
589590
"mastodon": "https://webperf.social/@tunetheweb",

src/static/css/ebook.css

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -133,14 +133,16 @@ tbody tr:nth-child(even) {
133133
display: flex;
134134
}
135135

136+
.contributor-avatars {
137+
min-width: 5rem;
138+
margin-bottom: 1rem;
139+
margin-right: 1rem;
140+
}
141+
136142
.contributor-avatar {
137143
border-radius: 50px;
138144
background-color: #f7f779;
139-
margin-bottom: 1rem;
140-
margin-right: 1rem;
141145
width: 5rem;
142-
max-width: 5rem;
143-
height: auto;
144146
transition-duration: 0.3s;
145147
flex: 1;
146148
}

src/templates/base.html

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,10 @@
6969
<path d="M60.7539 14.3904C59.8143 7.40642 53.7273 1.90257 46.5117 0.836066C45.2943 0.655854 40.6819 0 29.9973 0H29.9175C19.2299 0 16.937 0.655854 15.7196 0.836066C8.70488 1.87302 2.29885 6.81852 0.744617 13.8852C-0.00294988 17.3654 -0.0827298 21.2237 0.0561464 24.7629C0.254119 29.8384 0.292531 34.905 0.753482 39.9598C1.07215 43.3175 1.62806 46.6484 2.41704 49.9276C3.89445 55.9839 9.87499 61.0239 15.7344 63.0801C22.0077 65.2244 28.7542 65.5804 35.2184 64.1082C35.9295 63.9428 36.6318 63.7508 37.3252 63.5321C38.8971 63.0329 40.738 62.4745 42.0913 61.4937C42.1099 61.4799 42.1251 61.4621 42.1358 61.4417C42.1466 61.4212 42.1526 61.3986 42.1534 61.3755V56.4773C42.153 56.4557 42.1479 56.4345 42.1383 56.4151C42.1287 56.3958 42.1149 56.3788 42.0979 56.3655C42.0809 56.3522 42.0611 56.3429 42.04 56.3382C42.019 56.3335 41.9971 56.3336 41.9761 56.3384C37.8345 57.3276 33.5905 57.8234 29.3324 57.8156C22.0045 57.8156 20.0336 54.3384 19.4693 52.8908C19.0156 51.6397 18.7275 50.3346 18.6124 49.0088C18.6112 48.9866 18.6153 48.9643 18.6243 48.9439C18.6333 48.9236 18.647 48.9056 18.6643 48.8915C18.6816 48.8774 18.7019 48.8675 18.7237 48.8628C18.7455 48.858 18.7681 48.8585 18.7897 48.8641C22.8622 49.8465 27.037 50.3423 31.2265 50.3412C32.234 50.3412 33.2387 50.3412 34.2463 50.3146C38.4598 50.1964 42.9009 49.9808 47.0465 49.1713C47.1499 49.1506 47.2534 49.1329 47.342 49.1063C53.881 47.8507 60.1038 43.9097 60.7362 33.9301C60.7598 33.5372 60.8189 29.8148 60.8189 29.4071C60.8218 28.0215 61.2651 19.5781 60.7539 14.3904Z" fill="currentColor"/>
7070
<path d="M50.3943 22.237V39.5876H43.5185V22.7481C43.5185 19.2029 42.0411 17.3949 39.036 17.3949C35.7325 17.3949 34.0778 19.5338 34.0778 23.7585V32.9759H27.2434V23.7585C27.2434 19.5338 25.5857 17.3949 22.2822 17.3949C19.2949 17.3949 17.8027 19.2029 17.8027 22.7481V39.5876H10.9298V22.237C10.9298 18.6918 11.835 15.8754 13.6453 13.7877C15.5128 11.7049 17.9623 10.6355 21.0028 10.6355C24.522 10.6355 27.1813 11.9885 28.9542 14.6917L30.665 17.5633L32.3788 14.6917C34.1517 11.9885 36.811 10.6355 40.3243 10.6355C43.3619 10.6355 45.8114 11.7049 47.6847 13.7877C49.4931 15.8734 50.3963 18.6899 50.3943 22.237Z" fill="white"/>
7171
</symbol>
72+
<!-- Bluesky -->
73+
<symbol id="bluesky-logo" viewBox="0 0 600 530">
74+
<path d="m135.72 44.03c66.496 49.921 138.02 151.14 164.28 205.46 26.262-54.316 97.782-155.54 164.28-205.46 47.98-36.021 125.72-63.892 125.72 24.795 0 17.712-10.155 148.79-16.111 170.07-20.703 73.984-96.144 92.854-163.25 81.433 117.3 19.964 147.14 86.092 82.697 152.22-122.39 125.59-175.91-31.511-189.63-71.766-2.514-7.3797-3.6904-10.832-3.7077-7.8964-0.0174-2.9357-1.1937 0.51669-3.7077 7.8964-13.714 40.255-67.233 197.36-189.63 71.766-64.444-66.128-34.605-132.26 82.697-152.22-67.108 11.421-142.55-7.4491-163.25-81.433-5.9562-21.282-16.111-152.36-16.111-170.07 0-88.687 77.742-60.816 125.72-24.795z" fill="currentColor"/>
75+
</symbol>
7276
<!-- Globe -->
7377
<symbol id="globe-logo" viewBox="0 0 30 30">
7478
<circle cx="14.5" cy="14.5" r="13.5" stroke-width="2" stroke-miterlimit="10" fill="none" stroke="currentColor" />

src/templates/base/base_chapter.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -275,6 +275,15 @@ <h2 id="authors">
275275
@{{ authordata.mastodon }}
276276
</a>
277277
{% endif %}
278+
{% if authordata.bluesky %}
279+
<a class="bluesky" href="https://bsky.app/{{ authordata.bluesky }}" aria-labelledby="author-{{ author }}-bluesky">
280+
<svg width="22" height="22" role="img">
281+
<title id="author-{{ author }}-bluesky">{{ onBluesky(authordata.bluesky) }}</title>
282+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
283+
</svg>
284+
@{{ authordata.bluesky }}
285+
</a>
286+
{% endif %}
278287
{% if authordata.github %}
279288
<a class="github" href="https://github.com/{{ authordata.github }}" aria-labelledby="author-{{ author }}-github">
280289
<svg width="22" height="20">

src/templates/base/base_ebook.html

Lines changed: 18 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -356,11 +356,13 @@ <h1 class="title title-lg">
356356
<ul class="contributors">
357357
{% for id, contributor in config.contributors.items() %}
358358
<li class="contributor" id="contributors-{{ id }}">
359-
{% if contributor.avatar_url|int != 0 %}
360-
<img class="contributor-avatar" src="https://avatars.githubusercontent.com/u/{{ contributor.avatar_url }}?v=4&s=100" height="100" width="100" alt="{{ contributor.name }} avatar">
361-
{% else %}
362-
<img class="contributor-avatar" src="{{ contributor.avatar_url }}" height="100" width="100" alt="{{ contributor.name }} avatar">
363-
{% endif %}
359+
<div class="contributor-avatars">
360+
{% if contributor.avatar_url|int != 0 %}
361+
<img class="contributor-avatar" src="https://avatars.githubusercontent.com/u/{{ contributor.avatar_url }}?v=4&s=100" height="100" width="100" alt="{{ contributor.name }} avatar">
362+
{% else %}
363+
<img class="contributor-avatar" src="{{ contributor.avatar_url }}" height="100" width="100" alt="{{ contributor.name }} avatar">
364+
{% endif %}
365+
</div>
364366
<div>
365367
<div class="contributor-name">{{ contributor.name }}</div>
366368
{% if contributor.twitter %}
@@ -385,6 +387,17 @@ <h1 class="title title-lg">
385387
</a>
386388
</div>
387389
{% endif %}
390+
{% if contributor.bluesky %}
391+
<div class="contributor-social">
392+
<a href="https://bsky.app/{{ contributor.bluesky }}" aria-labelledby="contributors-{{ id }}-bluesky">
393+
<svg role="img">
394+
<title id="contributors-{{ id }}-bluesky">{{ onBluesky(contributor.bluesky) }}</title>
395+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
396+
</svg>
397+
{{ contributor.bluesky }}
398+
</a>
399+
</div>
400+
{% endif %}
388401
{% if contributor.github %}
389402
<div class="contributor-social">
390403
<a href="https://github.com/{{ contributor.github }}" aria-labelledby="contributors-{{ id }}-github">

src/templates/base/contributors.html

Lines changed: 16 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@
137137
}
138138

139139
.contributor-teams {
140-
margin-top: 5px;
140+
margin: 5px 0;
141141
text-align: center;
142142
color: #757575;
143143
font-size: 14px;
@@ -334,6 +334,13 @@ <h1 class="title title-lg">
334334
</svg>
335335
</a>
336336
{% endif %}
337+
{% if contributor.bluesky %}
338+
<a href="https://bsky.app/{{ contributor.bluesky }}" aria-label="{{ onBluesky(contributor.bluesky) }}">
339+
<svg width="22" height="22" role="img">
340+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
341+
</svg>
342+
</a>
343+
{% endif %}
337344
{% if contributor.github %}
338345
<a href="https://github.com/{{ contributor.github }}" aria-label="{{ onGitHub(contributor.github) }}">
339346
<svg width="22" height="20" role="img">
@@ -355,11 +362,6 @@ <h1 class="title title-lg">
355362
</svg>
356363
</a>
357364
{% endif %}
358-
<a href="/{{ lang }}/search?q={{ contributor.name | urlencode }}" aria-label="{{ self.search_title() }} {{ contributor.name }}">
359-
<svg width="22" height="22" role="img">
360-
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#search-logo"></use>
361-
</svg>
362-
</a>
363365
</div>
364366

365367
<div class="contributor-teams">
@@ -368,6 +370,14 @@ <h1 class="title title-lg">
368370
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
369371
{% endfor %}
370372
</div>
373+
374+
<div class="contributor-search">
375+
<a href="/{{ lang }}/search?q={{ contributor.name | urlencode }}" aria-label="{{ self.search_title() }} {{ contributor.name }}">
376+
<svg width="22" height="22" role="img">
377+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#search-logo"></use>
378+
</svg>
379+
</a>
380+
</div>
371381
</li>
372382
{% endfor %}
373383
</ul>

src/templates/base/ebook.ejs.html

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,13 @@ <h2 id="{{ metadata.get('chapter') }}-authors">
8686
{% endif %}
8787
{% set authordata = config.contributors[author] if author in config.contributors else None %}
8888
<li>
89-
{% if authordata.avatar_url|int != 0 %}
90-
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="https://avatars.githubusercontent.com/u/{{ authordata.avatar_url }}?v=4&s=200" height="200" width="200"></a>
91-
{% else %}
92-
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="{{ authordata.avatar_url }}" height="200" width="200"></a>
93-
{% endif %}
89+
<div class="contributor-avatars">
90+
{% if authordata.avatar_url|int != 0 %}
91+
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="https://avatars.githubusercontent.com/u/{{ authordata.avatar_url }}?v=4&s=200" height="200" width="200"></a>
92+
{% else %}
93+
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="{{ authordata.avatar_url }}" height="200" width="200"></a>
94+
{% endif %}
95+
</div>
9496
<div class="info">
9597
<a href="#contributors-{{ author }}"><span class="name">{{ authordata.name }}</span></a>
9698
{% if authordata.twitter or authordata.github or authordata.linkedin or authordata.website %}
@@ -113,6 +115,15 @@ <h2 id="{{ metadata.get('chapter') }}-authors">
113115
@{{ authordata.mastodon }}
114116
</a>
115117
{% endif %}
118+
{% if authordata.bluesky %}
119+
<a class="bluesky" href="https://bsky.app/{{ authordata.bluesky }}" aria-labelledby="{{ metadata.get('chapter') }}-author-{{ author }}-bluesky">
120+
<svg aria-hidden="true">
121+
<title id="{{ metadata.get('chapter') }}-author-{{ author }}-bluesky">{{ onBluesky(authordata.bluesky) }}</title>
122+
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
123+
</svg>
124+
@{{ authordata.bluesky }}
125+
</a>
126+
{% endif %}
116127
{% if authordata.github %}
117128
<a class="github" href="https://github.com/{{ authordata.github }}" aria-labelledby="{{ metadata.get('chapter') }}-author-{{ author }}-github">
118129
<svg aria-hidden="true">

src/templates/en/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113

114114
{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} on Twitter{% endmacro %}
115115
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} on Mastodon{% endmacro %}
116+
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} on BlueSky{% endmacro %}
116117
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} on GitHub{% endmacro %}
117118
{% macro onLinkedIn(authorName) %}{{authorName}} on LinkedIn{% endmacro %}
118119
{% macro website(authorName) %}{{authorName}} website{% endmacro %}

src/templates/es/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113

114114
{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} en Twitter{% endmacro %}
115115
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} en Mastodon{% endmacro %}
116+
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} en Bluesky{% endmacro %}
116117
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} en GitHub{% endmacro %}
117118
{% macro onLinkedIn(authorName) %}{{authorName}} en LinkedIn{% endmacro %}
118119
{% macro website(authorName) %}{{authorName}} sitio web{% endmacro %}

src/templates/fr/base.html

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,7 @@
113113

114114
{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} sur Twitter{% endmacro %}
115115
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} sur Mastodon{% endmacro %}
116+
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} sur Bluesky{% endmacro %}
116117
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} sur GitHub{% endmacro %}
117118
{% macro onLinkedIn(authorName) %}{{authorName}} sur LinkedIn{% endmacro %}
118119
{% macro website(authorName) %}site web de {{authorName}}{% endmacro %}

0 commit comments

Comments
 (0)