From f4a6e184a9a23c2a2070b0ea545d390fab1e5c98 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 5205c9f6f7e9..c2d7269e7bab 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 86aecc50705c..c9837bbc1dbe 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 }}