From ee2c5605bf057429139b6abd978875d53e8fca1d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tiago=20Lob=C3=A3o?= Date: Mon, 24 Jun 2024 11:53:47 -0300 Subject: [PATCH] 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) --- _data/repositories.yml | 6 ++++-- _includes/repository/repo.liquid | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/_data/repositories.yml b/_data/repositories.yml index 5205c9f..c2d7269 100644 --- a/_data/repositories.yml +++ b/_data/repositories.yml @@ -2,11 +2,13 @@ github_users: - torvalds - alshedivat +repo_description_lines_max: 2 + github_repos: - alshedivat/al-folio - - twbs/bootstrap - jekyll/jekyll + - twbs/bootstrap - jquery/jquery - FortAwesome/Font-Awesome - - jpswalsh/academicons - mathjax/MathJax + - jpswalsh/academicons diff --git a/_includes/repository/repo.liquid b/_includes/repository/repo.liquid index 86aecc5..c9837bb 100644 --- a/_includes/repository/repo.liquid +++ b/_includes/repository/repo.liquid @@ -5,17 +5,23 @@ {% assign show_owner = true %} {% 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 %} +
{{ include.repository }} {{ include.repository }}