Skip to content

Commit 2245f18

Browse files
author
Animesh Garg
committed
updated the repo card rendering
1 parent 7f0fa46 commit 2245f18

4 files changed

Lines changed: 30 additions & 1 deletion

File tree

_data/repositories.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
github_users:
22

3-
43
repo_description_lines_max: 2
54

65
github_repos:

_includes/repository/repo.liquid

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,12 +36,18 @@
3636
<img
3737
class="only-light w-100"
3838
alt="{{ include.repository }}"
39+
onerror="this.style.display='none'; this.parentElement.querySelector('.repo-fallback').style.display='block';"
3940
src="{{ site.external_services.github_readme_stats_url }}/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_light }}&locale={{ lang }}&show_owner={{ show_owner }}&description_lines_count={{ max_lines }}"
4041
>
4142
<img
4243
class="only-dark w-100"
4344
alt="{{ include.repository }}"
45+
onerror="this.style.display='none'; this.parentElement.querySelector('.repo-fallback').style.display='block';"
4446
src="{{ site.external_services.github_readme_stats_url }}/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_dark }}&locale={{ lang }}&show_owner={{ show_owner }}&description_lines_count={{ max_lines }}"
4547
>
48+
<div class="repo-fallback w-100 border rounded p-3 text-left" style="display: none;">
49+
<h6 class="mb-1">{{ include.repository }}</h6>
50+
<small class="text-muted">Repository card is temporarily unavailable. Open on GitHub.</small>
51+
</div>
4652
</a>
4753
</div>

_includes/repository/repo_trophies.liquid

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,39 +4,57 @@
44
<img
55
class="only-light"
66
alt="{{ include.username }}"
7+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
78
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=6"
89
>
910
<img
1011
class="only-dark"
1112
alt="{{ include.username }}"
13+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
1214
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=6"
1315
>
16+
<div class="trophy-fallback w-100 border rounded p-3 text-left" style="display: none;">
17+
<h6 class="mb-1">{{ include.username }}</h6>
18+
<small class="text-muted">GitHub trophies are temporarily unavailable.</small>
19+
</div>
1420
</span>
1521

1622
<span class="d-none d-sm-block d-md-none">
1723
<img
1824
class="only-light"
1925
alt="{{ include.username }}"
26+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
2027
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=4"
2128
>
2229
<img
2330
class="only-dark"
2431
alt="{{ include.username }}"
32+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
2533
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=4"
2634
>
35+
<div class="trophy-fallback w-100 border rounded p-3 text-left" style="display: none;">
36+
<h6 class="mb-1">{{ include.username }}</h6>
37+
<small class="text-muted">GitHub trophies are temporarily unavailable.</small>
38+
</div>
2739
</span>
2840

2941
<span class="d-block d-sm-none">
3042
<img
3143
class="only-light"
3244
alt="{{ include.username }}"
45+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
3346
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=3"
3447
>
3548
<img
3649
class="only-dark"
3750
alt="{{ include.username }}"
51+
onerror="this.style.display='none'; this.parentElement.querySelector('.trophy-fallback').style.display='block';"
3852
src="{{ site.external_services.github_profile_trophy_url }}/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C&column=3"
3953
>
54+
<div class="trophy-fallback w-100 border rounded p-3 text-left" style="display: none;">
55+
<h6 class="mb-1">{{ include.username }}</h6>
56+
<small class="text-muted">GitHub trophies are temporarily unavailable.</small>
57+
</div>
4058
</span>
4159
</a>
4260
</div>

_includes/repository/repo_user.liquid

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,18 @@
2323
<img
2424
class="only-light w-100"
2525
alt="{{ include.username }}"
26+
onerror="this.style.display='none'; this.parentElement.querySelector('.repo-fallback').style.display='block';"
2627
src="{{ site.external_services.github_readme_stats_url }}/api/?username={{ include.username }}&theme={{ site.repo_theme_light }}&locale={{ lang }}&show_icons=true"
2728
>
2829
<img
2930
class="only-dark w-100"
3031
alt="{{ include.username }}"
32+
onerror="this.style.display='none'; this.parentElement.querySelector('.repo-fallback').style.display='block';"
3133
src="{{ site.external_services.github_readme_stats_url }}/api/?username={{ include.username }}&theme={{ site.repo_theme_dark }}&locale={{ lang }}&show_icons=true"
3234
>
35+
<div class="repo-fallback w-100 border rounded p-3 text-left" style="display: none;">
36+
<h6 class="mb-1">{{ include.username }}</h6>
37+
<small class="text-muted">GitHub profile card is temporarily unavailable. Open profile.</small>
38+
</div>
3339
</a>
3440
</div>

0 commit comments

Comments
 (0)