Skip to content

Commit 56480a7

Browse files
authored
Added github 🏆 section in repositories (alshedivat#1229)
Creates a new section with user trophies.
1 parent f4a369b commit 56480a7

4 files changed

Lines changed: 39 additions & 2 deletions

File tree

README.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,8 @@ Easily create beautiful grids within your blog posts and project pages:
515515
### Other features
516516

517517
#### GitHub repositories and user stats
518-
**al-folio** uses [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) to display GitHub repositories and user stats on the the `/repositories/` page.
518+
**al-folio** uses [github-readme-stats](https://github.com/anuraghazra/github-readme-stats) and [github-profile-trophy](https://github.com/ryo-ma/github-profile-trophy)
519+
to display GitHub repositories and user stats on the the `/repositories/` page.
519520

520521
Edit the `_data/repositories.yml` and change the `github_users` and `github_repos` lists to include your own GitHub profile and repositories to the the `/repositories/` page.
521522

@@ -530,6 +531,18 @@ You may also use the following codes for displaying this in any other pages.
530531
</div>
531532
{% endif %}
532533
534+
<!-- code for Github trophies -->
535+
{% if site.repo_trophies.enabled %}
536+
{% for user in site.data.repositories.github_users %}
537+
{% if site.data.repositories.github_users.size > 1 %}
538+
<h4>{{ user }}</h4>
539+
{% endif %}
540+
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
541+
{% include repository/repo_trophies.html username=user %}
542+
</div>
543+
{% endfor %}
544+
{% endif %}
545+
533546
<!-- code for GitHub repositories -->
534547
{% if site.data.repositories.github_repos %}
535548
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">

_config.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,10 @@ highlight_theme_dark: native # https://github.com/jwarby/jekyll-pygments-them
3434
# repo color theme
3535
repo_theme_light: default # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
3636
repo_theme_dark: dark # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
37+
repo_trophies:
38+
enabled: true
39+
theme_light: flat # https://github.com/ryo-ma/github-profile-trophy
40+
theme_dark: gitdimmed # https://github.com/ryo-ma/github-profile-trophy
3741

3842
# -----------------------------------------------------------------------------
3943
# RSS Feed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
<div class="repo p-2 text-center">
2+
<a href="https://github.com/ryo-ma/github-profile-trophy">
3+
<img class="repo-img-light w-200" alt="{{ include.username }}" src="https://github-profile-trophy.vercel.app/?username={{ include.username }}&theme={{ site.repo_trophies.theme_light }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C">
4+
<img class="repo-img-dark w-200" alt="{{ include.username }}" src="https://github-profile-trophy.vercel.app/?username={{ include.username }}&theme={{ site.repo_trophies.theme_dark }}&locale={{ site.lang }}&margin-w=15&margin-h=15&no-bg=true&rank=-C">
5+
</a>
6+
</div>

_pages/repositories.md

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,24 @@ nav_order: 3
1515
{% include repository/repo_user.html username=user %}
1616
{% endfor %}
1717
</div>
18-
{% endif %}
1918

2019
---
2120

21+
{% if site.repo_trophies.enabled %}
22+
{% for user in site.data.repositories.github_users %}
23+
{% if site.data.repositories.github_users.size > 1 %}
24+
<h4>{{ user }}</h4>
25+
{% endif %}
26+
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
27+
{% include repository/repo_trophies.html username=user %}
28+
</div>
29+
30+
---
31+
32+
{% endfor %}
33+
{% endif %}
34+
{% endif %}
35+
2236
## GitHub Repositories
2337

2438
{% if site.data.repositories.github_repos %}

0 commit comments

Comments
 (0)