Fix repo card heigth for different repo descriptions (#2525)

Hello! I had this minor issue on my website and I saw few other people
using this template and having the same issue.

**Brief**
if two repo's in the same row has different number of lines for the
descriptions, heights of the cards will not be the same if we don't
force the number of lines to be displayed.

**Solution**
By looking at [This
issue](https://github.com/anuraghazra/github-readme-stats/issues/2900) I
could see that they solved it by adding an new option,
`description_lines_count`. This was used on the API request in order to
fix the issue.

---

## Issue reproduced:


![before](https://github.com/alshedivat/al-folio/assets/15076325/238931f5-8a0e-45c5-a9bb-e9c6e4c0f04b)

---

## Issue fixed after the commit:


![after](https://github.com/alshedivat/al-folio/assets/15076325/a0e79cdf-fd6a-4765-b21f-279540ae88fe)
This commit is contained in:
Tiago Lobão 2024-06-24 11:53:47 -03:00 committed by GitHub
parent fefa2470b4
commit f4a6e184a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 12 additions and 4 deletions

View File

@ -2,11 +2,13 @@ github_users:
- torvalds - torvalds
- alshedivat - alshedivat
repo_description_lines_max: 2
github_repos: github_repos:
- alshedivat/al-folio - alshedivat/al-folio
- twbs/bootstrap
- jekyll/jekyll - jekyll/jekyll
- twbs/bootstrap
- jquery/jquery - jquery/jquery
- FortAwesome/Font-Awesome - FortAwesome/Font-Awesome
- jpswalsh/academicons
- mathjax/MathJax - mathjax/MathJax
- jpswalsh/academicons

View File

@ -5,17 +5,23 @@
{% assign show_owner = true %} {% assign show_owner = true %}
{% endif %} {% endif %}
{% if site.data.repositories.repo_description_lines_max %}
{% assign max_lines = site.data.repositories.repo_description_lines_max %}
{% else %}
{% assign max_lines = 2 %}
{% endif %}
<div class="repo p-2 text-center"> <div class="repo p-2 text-center">
<a href="https://github.com/{{ include.repository }}"> <a href="https://github.com/{{ include.repository }}">
<img <img
class="repo-img-light w-100" class="repo-img-light w-100"
alt="{{ include.repository }}" alt="{{ include.repository }}"
src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_light }}&show_owner={{ show_owner }}" src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_light }}&show_owner={{ show_owner }}&description_lines_count={{ max_lines }}"
> >
<img <img
class="repo-img-dark w-100" class="repo-img-dark w-100"
alt="{{ include.repository }}" alt="{{ include.repository }}"
src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_dark }}&show_owner={{ show_owner }}" src="https://github-readme-stats.vercel.app/api/pin/?username={{ repo_url[0] }}&repo={{ repo_url[1] }}&theme={{ site.repo_theme_dark }}&show_owner={{ show_owner }}&description_lines_count={{ max_lines }}"
> >
</a> </a>
</div> </div>