Skip to content

Commit

Permalink
Add Bluesky profile link support (#3824)
Browse files Browse the repository at this point in the history
  • Loading branch information
tunetheweb authored Nov 3, 2024
1 parent c214a3b commit c89dd29
Show file tree
Hide file tree
Showing 20 changed files with 83 additions and 20 deletions.
1 change: 1 addition & 0 deletions src/config/contributors.json
Original file line number Diff line number Diff line change
Expand Up @@ -584,6 +584,7 @@
},
"tunetheweb": {
"avatar_url": "10931297",
"bluesky": "tunetheweb.com",
"github": "tunetheweb",
"linkedin": "tunetheweb",
"mastodon": "https://webperf.social/@tunetheweb",
Expand Down
10 changes: 6 additions & 4 deletions src/static/css/ebook.css
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ tbody tr:nth-child(even) {
display: flex;
}

.contributor-avatars {
min-width: 5rem;
margin-bottom: 1rem;
margin-right: 1rem;
}

.contributor-avatar {
border-radius: 50px;
background-color: #f7f779;
margin-bottom: 1rem;
margin-right: 1rem;
width: 5rem;
max-width: 5rem;
height: auto;
transition-duration: 0.3s;
flex: 1;
}
Expand Down
4 changes: 4 additions & 0 deletions src/templates/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
<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"/>
<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"/>
</symbol>
<!-- Bluesky -->
<symbol id="bluesky-logo" viewBox="0 0 600 530">
<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"/>
</symbol>
<!-- Globe -->
<symbol id="globe-logo" viewBox="0 0 30 30">
<circle cx="14.5" cy="14.5" r="13.5" stroke-width="2" stroke-miterlimit="10" fill="none" stroke="currentColor" />
Expand Down
9 changes: 9 additions & 0 deletions src/templates/base/base_chapter.html
Original file line number Diff line number Diff line change
Expand Up @@ -275,6 +275,15 @@ <h2 id="authors">
@{{ authordata.mastodon }}
</a>
{% endif %}
{% if authordata.bluesky %}
<a class="bluesky" href="https://bsky.app/{{ authordata.bluesky }}" aria-labelledby="author-{{ author }}-bluesky">
<svg width="22" height="22" role="img">
<title id="author-{{ author }}-bluesky">{{ onBluesky(authordata.bluesky) }}</title>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
</svg>
@{{ authordata.bluesky }}
</a>
{% endif %}
{% if authordata.github %}
<a class="github" href="https://github.com/{{ authordata.github }}" aria-labelledby="author-{{ author }}-github">
<svg width="22" height="20">
Expand Down
23 changes: 18 additions & 5 deletions src/templates/base/base_ebook.html
Original file line number Diff line number Diff line change
Expand Up @@ -356,11 +356,13 @@ <h1 class="title title-lg">
<ul class="contributors">
{% for id, contributor in config.contributors.items() %}
<li class="contributor" id="contributors-{{ id }}">
{% if contributor.avatar_url|int != 0 %}
<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">
{% else %}
<img class="contributor-avatar" src="{{ contributor.avatar_url }}" height="100" width="100" alt="{{ contributor.name }} avatar">
{% endif %}
<div class="contributor-avatars">
{% if contributor.avatar_url|int != 0 %}
<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">
{% else %}
<img class="contributor-avatar" src="{{ contributor.avatar_url }}" height="100" width="100" alt="{{ contributor.name }} avatar">
{% endif %}
</div>
<div>
<div class="contributor-name">{{ contributor.name }}</div>
{% if contributor.twitter %}
Expand All @@ -385,6 +387,17 @@ <h1 class="title title-lg">
</a>
</div>
{% endif %}
{% if contributor.bluesky %}
<div class="contributor-social">
<a href="https://bsky.app/{{ contributor.bluesky }}" aria-labelledby="contributors-{{ id }}-bluesky">
<svg role="img">
<title id="contributors-{{ id }}-bluesky">{{ onBluesky(contributor.bluesky) }}</title>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
</svg>
{{ contributor.bluesky }}
</a>
</div>
{% endif %}
{% if contributor.github %}
<div class="contributor-social">
<a href="https://github.com/{{ contributor.github }}" aria-labelledby="contributors-{{ id }}-github">
Expand Down
22 changes: 16 additions & 6 deletions src/templates/base/contributors.html
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@
}

.contributor-teams {
margin-top: 5px;
margin: 5px 0;
text-align: center;
color: #757575;
font-size: 14px;
Expand Down Expand Up @@ -334,6 +334,13 @@ <h1 class="title title-lg">
</svg>
</a>
{% endif %}
{% if contributor.bluesky %}
<a href="https://bsky.app/{{ contributor.bluesky }}" aria-label="{{ onBluesky(contributor.bluesky) }}">
<svg width="22" height="22" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
</svg>
</a>
{% endif %}
{% if contributor.github %}
<a href="https://github.com/{{ contributor.github }}" aria-label="{{ onGitHub(contributor.github) }}">
<svg width="22" height="20" role="img">
Expand All @@ -355,11 +362,6 @@ <h1 class="title title-lg">
</svg>
</a>
{% endif %}
<a href="/{{ lang }}/search?q={{ contributor.name | urlencode }}" aria-label="{{ self.search_title() }} {{ contributor.name }}">
<svg width="22" height="22" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#search-logo"></use>
</svg>
</a>
</div>

<div class="contributor-teams">
Expand All @@ -368,6 +370,14 @@ <h1 class="title title-lg">
{% if loop.index == loop.length - 1 %}{{ self.and() }}{% endif %}
{% endfor %}
</div>

<div class="contributor-search">
<a href="/{{ lang }}/search?q={{ contributor.name | urlencode }}" aria-label="{{ self.search_title() }} {{ contributor.name }}">
<svg width="22" height="22" role="img">
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#search-logo"></use>
</svg>
</a>
</div>
</li>
{% endfor %}
</ul>
Expand Down
21 changes: 16 additions & 5 deletions src/templates/base/ebook.ejs.html
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ <h2 id="{{ metadata.get('chapter') }}-authors">
{% endif %}
{% set authordata = config.contributors[author] if author in config.contributors else None %}
<li>
{% if authordata.avatar_url|int != 0 %}
<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>
{% else %}
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="{{ authordata.avatar_url }}" height="200" width="200"></a>
{% endif %}
<div class="contributor-avatars">
{% if authordata.avatar_url|int != 0 %}
<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>
{% else %}
<a class="avatar-link" href="#contributors-{{ author }}"><img class="avatar" alt="{{ authordata.name }} avatar" src="{{ authordata.avatar_url }}" height="200" width="200"></a>
{% endif %}
</div>
<div class="info">
<a href="#contributors-{{ author }}"><span class="name">{{ authordata.name }}</span></a>
{% if authordata.twitter or authordata.github or authordata.linkedin or authordata.website %}
Expand All @@ -113,6 +115,15 @@ <h2 id="{{ metadata.get('chapter') }}-authors">
@{{ authordata.mastodon }}
</a>
{% endif %}
{% if authordata.bluesky %}
<a class="bluesky" href="https://bsky.app/{{ authordata.bluesky }}" aria-labelledby="{{ metadata.get('chapter') }}-author-{{ author }}-bluesky">
<svg aria-hidden="true">
<title id="{{ metadata.get('chapter') }}-author-{{ author }}-bluesky">{{ onBluesky(authordata.bluesky) }}</title>
<use xmlns:xlink="http://www.w3.org/1999/xlink" xlink:href="#bluesky-logo"></use>
</svg>
@{{ authordata.bluesky }}
</a>
{% endif %}
{% if authordata.github %}
<a class="github" href="https://github.com/{{ authordata.github }}" aria-labelledby="{{ metadata.get('chapter') }}-author-{{ author }}-github">
<svg aria-hidden="true">
Expand Down
1 change: 1 addition & 0 deletions src/templates/en/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} on Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} on Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} on BlueSky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} on GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} on LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} website{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/es/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} en Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} en Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} en Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} en GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} en LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} sitio web{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/fr/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} sur Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} sur Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} sur Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} sur GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} sur LinkedIn{% endmacro %}
{% macro website(authorName) %}site web de {{authorName}}{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/hi/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} Twitter पर{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}}Mastodonपर{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}}Blueskyपर{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} GitHub पर{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} LinkedIn पर{% endmacro %}
{% macro website(authorName) %}{{authorName}} वेबसाइट{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/it/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} su Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} su Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} su Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} su GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} su LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} sito web{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/ja/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}Twitterの@{{twitterHandle}}{% endmacro %}
{% macro onMastodon(mastodonHandle) %}Mastodonの{{mastodonHandle}}{% endmacro %}
{% macro onBluesky(blueskyHandle) %}Blueskyの{{blueskyHandle}}{% endmacro %}
{% macro onGitHub(gitHubHandle) %}GitHubの{{gitHubHandle}}{% endmacro %}
{% macro onLinkedIn(authorName) %}LinkedInの{{authorName}}{% endmacro %}
{% macro website(authorName) %}{{authorName}} ウェブサイト{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/nl/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} op Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} op Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} op Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} op GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} op LinkedIn{% endmacro %}
{% macro website(authorName) %}website van {{authorName}} {% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/pt/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} no Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} on Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} on Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} no GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} no LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} website{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/ru/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} на Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} on Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} on Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} на GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} на LinkedIn{% endmacro %}
{% macro website(authorName) %}Сайт {{authorName}}{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/tr/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}}Twitter üzerinde{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}}Mastodon üzerinde{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}}Bluesky üzerinde{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}}GitHub üzerinde {% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} LinkedIn üzerinde {% endmacro %}
{% macro website(authorName) %}{{authorName}} website{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/uk/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} у Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} у Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} у Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} на GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} у LinkedIn{% endmacro %}
{% macro website(authorName) %}вебсайт {{authorName}}{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/zh-CN/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} 在 Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} 在 Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} 在 Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} 在 GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} 在 LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} 网站{% endmacro %}
Expand Down
1 change: 1 addition & 0 deletions src/templates/zh-TW/base.html
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@

{% macro onTwitter(twitterHandle) %}@{{twitterHandle}} Twitter{% endmacro %}
{% macro onMastodon(mastodonHandle) %}{{mastodonHandle}} Mastodon{% endmacro %}
{% macro onBluesky(blueskyHandle) %}{{blueskyHandle}} Bluesky{% endmacro %}
{% macro onGitHub(gitHubHandle) %}{{gitHubHandle}} GitHub{% endmacro %}
{% macro onLinkedIn(authorName) %}{{authorName}} LinkedIn{% endmacro %}
{% macro website(authorName) %}{{authorName}} 網站{% endmacro %}
Expand Down

0 comments on commit c89dd29

Please sign in to comment.