From 895ecfe12bd86fc523d2734f4ebb8dbb1240f7c5 Mon Sep 17 00:00:00 2001 From: David Durieux Date: Wed, 27 Mar 2024 07:09:02 +0100 Subject: [PATCH] Display last news in the homepage --- _includes/navheader.html | 26 +++++++++++++++++++++++++- _sass/layout/_masthead.scss | 2 +- 2 files changed, 26 insertions(+), 2 deletions(-) diff --git a/_includes/navheader.html b/_includes/navheader.html index a16be7b3..cb798e25 100644 --- a/_includes/navheader.html +++ b/_includes/navheader.html @@ -69,6 +69,30 @@ {%- if site.data.sitetext[page.lang].header.text -%}
{{ site.data.sitetext[page.lang].header.text | markdownify }}
{%- endif -%} + +
+
+ + {% if page.lang == "fr" %} + {% assign frPosts = site.posts | where: 'lang', 'fr' %} + {% for post in frPosts limit:1 %} + {{ post.date | date: "Dernière news le %-d %B %Y" }} : +
+ {{ post.title }} + {% endfor %} + {% endif %} + + {% if page.lang == "en" %} + {% assign enPosts = site.posts | where: 'lang', 'en' %} + {% for post in enPosts limit:1 %} + {{ post.date | date: "The last news on %-d %B %Y" }}: +
+ {{ post.title }} + {% endfor %} + {% endif %} +
+
+ {%- if site.data.sitetext[page.lang].header.button -%} {{ site.data.sitetext[page.lang].header.button }} {%- endif -%} @@ -77,4 +101,4 @@ {% endif %} - \ No newline at end of file + diff --git a/_sass/layout/_masthead.scss b/_sass/layout/_masthead.scss index 01e88bf5..2be7337a 100644 --- a/_sass/layout/_masthead.scss +++ b/_sass/layout/_masthead.scss @@ -42,7 +42,7 @@ header.masthead { font-size: 42px; font-weight: 700; line-height: 75px; - margin-bottom: 50px; + margin-bottom: 20px; @include heading-font; } }