From b50874f865fca0cf53877969f54ca847e567aa76 Mon Sep 17 00:00:00 2001 From: Benny Istanto Date: Fri, 10 Apr 2026 07:26:14 +0700 Subject: [PATCH 1/2] Shorten datasets description This PR will solve https://github.com/GFDRR/rdl-jkan/issues/154 --- _layouts/dataset.html | 14 +++++++++++++- css/modern-theme.css | 40 ++++++++++++++++++++++++++++++++++++++++ index.html | 12 +++++++++++- 3 files changed, 64 insertions(+), 2 deletions(-) diff --git a/_layouts/dataset.html b/_layouts/dataset.html index 86094d229..8c526afff 100644 --- a/_layouts/dataset.html +++ b/_layouts/dataset.html @@ -28,7 +28,19 @@

{{ page.title }}

-

{{ page.description }}

+
+

{{ page.description }}

+ +
+
diff --git a/css/modern-theme.css b/css/modern-theme.css index b8daf1395..b812296b8 100644 --- a/css/modern-theme.css +++ b/css/modern-theme.css @@ -616,6 +616,10 @@ body { font-size: 15px; color: var(--color-text-secondary); line-height: 1.6; + margin-bottom: 0; +} + +.dataset-card .desc-truncate { margin-bottom: 20px; } @@ -1336,3 +1340,39 @@ body { .mb-2 { margin-bottom: var(--spacing-md); } .mb-3 { margin-bottom: var(--spacing-lg); } .mb-4 { margin-bottom: var(--spacing-xl); } + +/* ==================================== + 17. Description Truncation + ==================================== */ +.desc-truncate { + position: relative; +} + +.desc-truncate .desc-text { + overflow: hidden; + display: -webkit-box; + -webkit-line-clamp: 3; + -webkit-box-orient: vertical; + transition: all 0.2s ease; +} + +.desc-truncate.expanded .desc-text { + -webkit-line-clamp: unset; + display: block; +} + +.desc-toggle { + display: inline-block; + margin-top: 6px; + font-size: 13px; + color: var(--color-primary, #2563eb); + cursor: pointer; + border: none; + background: none; + padding: 0; + font-weight: 500; +} + +.desc-toggle:hover { + text-decoration: underline; +} diff --git a/index.html b/index.html index 9878283a1..5b8d30ac3 100644 --- a/index.html +++ b/index.html @@ -730,7 +730,17 @@

Semantic

-

+
+

+ +