From c2620dae1b3b1a8dd15c3c86cc3c12cdecf6ba39 Mon Sep 17 00:00:00 2001 From: Saskia Hiltemann Date: Thu, 19 Dec 2024 16:49:31 +0100 Subject: [PATCH 1/3] news layout same as LP layout --- _includes/news-card.html | 57 ++++++++++++++++++++-------------------- assets/css/main.scss | 2 +- news.md | 5 ++-- 3 files changed, 33 insertions(+), 31 deletions(-) diff --git a/_includes/news-card.html b/_includes/news-card.html index def48d39b62b02..68270d381c0f41 100644 --- a/_includes/news-card.html +++ b/_includes/news-card.html @@ -1,4 +1,3 @@ -
{% assign n = include.news %} {% if n.cover %} @@ -18,38 +17,40 @@ {% assign coverimagealt = "GTN logo with a multi-coloured star and the words Galaxy Training Network" %} {% endif %} -
+ + diff --git a/assets/css/main.scss b/assets/css/main.scss index d340dcb5e67dc4..686ae4b333bbf2 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -774,7 +774,7 @@ blockquote { vertical-align: center; } .card-title{ - height: 5rem; + height: 6rem; } .card-header { background: var(--brand-color); diff --git a/news.md b/news.md index 1cc67a73fa4bf2..bb2c769038854c 100644 --- a/news.md +++ b/news.md @@ -7,12 +7,13 @@ Keep an eye on this page for the latest news around the GTN. New tutorials, GTN Want to add your own news here (e.g. new tutorial, event, publication, anything else training related)? Check out how to do that in [this FAQ]({% link faqs/gtn/gtn_news_create_post.md %}) -
-{% for n in site.categories['news'] %} +
+{% for n in site.categories['news'] %} {% include _includes/news-card.html news=n %} {% endfor %} +
From e29d4490e73c1a025e1d2a540408d8d3f9ce6979 Mon Sep 17 00:00:00 2001 From: Saskia Hiltemann Date: Fri, 20 Dec 2024 11:39:42 +0100 Subject: [PATCH 2/3] add authors to cards --- _includes/news-card.html | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/_includes/news-card.html b/_includes/news-card.html index 68270d381c0f41..af2bfcd825d662 100644 --- a/_includes/news-card.html +++ b/_includes/news-card.html @@ -18,27 +18,36 @@ {% endif %} -
- +
+
- {{ coverimagealt }}
- +
{{n.title}}
{{ n.date | date: "%-d %B %Y" }} +
+ {% for id in n.contributions.authorship %} + {% include _includes/contributor-badge.html id=id small=true %} + {% endfor %} +
+ + + {% if n.external %} This is an external post, please follow the link to read it. {% else %} {{ n.excerpt | strip_html }} {% endif %} +
+
- -
+
From 1503f8c5406e06609fd67cfcffd0ad145eec08bf Mon Sep 17 00:00:00 2001 From: Saskia Hiltemann Date: Fri, 20 Dec 2024 11:59:42 +0100 Subject: [PATCH 3/3] upate styling of small contributor badges --- _includes/contributor-badge.html | 10 +++++----- _includes/news-card.html | 8 +++----- assets/css/main.scss | 5 +++++ 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/_includes/contributor-badge.html b/_includes/contributor-badge.html index 02b68829c51e89..fa94c6b7552174 100644 --- a/_includes/contributor-badge.html +++ b/_includes/contributor-badge.html @@ -3,11 +3,11 @@ {%- else -%} {%- assign contributor_badge_entity = site | fetch_contributor: include.id -%} {%- assign name = contributor_badge_entity.short_name | default: contributor_badge_entity.name | default: include.id -%} - {% if include.small %} - - {{ contributor_badge_entity | fetch_entity_avatar:include.id, 36 }} + {%- if include.small -%} + + {{- contributor_badge_entity | fetch_entity_avatar:include.id, 36 -}} - {% else %} + {%- else -%} {%- if contributor_badge_entity.orcid -%}orcid logo{%- endif -%} {{ contributor_badge_entity | fetch_entity_avatar:include.id, 36 }} @@ -16,5 +16,5 @@ {%- include _includes/contributor-human-icons.html activity=include.activity -%} {%- endif -%} - {% endif %} + {%- endif -%} {%- endif -%} diff --git a/_includes/news-card.html b/_includes/news-card.html index af2bfcd825d662..6e09585cb59321 100644 --- a/_includes/news-card.html +++ b/_includes/news-card.html @@ -28,13 +28,11 @@
{{n.title}}
+ {% for id in n.contributions.authorship %} + {% include _includes/contributor-badge.html id=id small=true %} + {% endfor %}
{{ n.date | date: "%-d %B %Y" }} -
- {% for id in n.contributions.authorship %} - {% include _includes/contributor-badge.html id=id small=true %} - {% endfor %} -
diff --git a/assets/css/main.scss b/assets/css/main.scss index 686ae4b333bbf2..e414dab75ee7de 100644 --- a/assets/css/main.scss +++ b/assets/css/main.scss @@ -1220,6 +1220,11 @@ nav[data-toggle='toc'] { } } +.contributor-badge-small{ + border: none; + padding-right: 0em; +} + .contributor-badge-inline { /* prevent breaking across lines */ white-space: nowrap;