Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added github 🏆 section in repositories #1229

Merged
merged 2 commits into from
Mar 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 14 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -488,7 +488,8 @@ Easily create beautiful grids within your blog posts and project pages:
### Other features

#### GitHub repositories and user stats
**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.
**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)
to display GitHub repositories and user stats on the the `/repositories/` page.

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.

Expand All @@ -503,6 +504,18 @@ You may also use the following codes for displaying this in any other pages.
</div>
{% endif %}

<!-- code for Github trophies -->
{% if site.repo_trophies.enabled %}
{% for user in site.data.repositories.github_users %}
{% if site.data.repositories.github_users.size > 1 %}
<h4>{{ user }}</h4>
{% endif %}
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{% include repository/repo_trophies.html username=user %}
</div>
{% endfor %}
{% endif %}

<!-- code for GitHub repositories -->
{% if site.data.repositories.github_repos %}
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
Expand Down
4 changes: 4 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,10 @@ highlight_theme_dark: native # https://github.com/jwarby/jekyll-pygments-them
# repo color theme
repo_theme_light: default # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
repo_theme_dark: dark # https://github.com/anuraghazra/github-readme-stats/blob/master/themes/README.md
repo_trophies:
enabled: true
theme_light: flat # https://github.com/ryo-ma/github-profile-trophy
theme_dark: gitdimmed # https://github.com/ryo-ma/github-profile-trophy

# -----------------------------------------------------------------------------
# RSS Feed
Expand Down
6 changes: 6 additions & 0 deletions _includes/repository/repo_trophies.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<div class="repo p-2 text-center">
<a href="https://github.com/ryo-ma/github-profile-trophy">
<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">
<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">
</a>
</div>
16 changes: 15 additions & 1 deletion _pages/repositories.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,24 @@ nav_order: 3
{% include repository/repo_user.html username=user %}
{% endfor %}
</div>
{% endif %}

---

{% if site.repo_trophies.enabled %}
{% for user in site.data.repositories.github_users %}
{% if site.data.repositories.github_users.size > 1 %}
<h4>{{ user }}</h4>
{% endif %}
<div class="repositories d-flex flex-wrap flex-md-row flex-column justify-content-between align-items-center">
{% include repository/repo_trophies.html username=user %}
</div>

---

{% endfor %}
{% endif %}
{% endif %}

## GitHub Repositories

{% if site.data.repositories.github_repos %}
Expand Down