Skip to content

Commit

Permalink
Display last news in the homepage
Browse files Browse the repository at this point in the history
  • Loading branch information
ddurieux committed Mar 27, 2024
1 parent 33a0755 commit 895ecfe
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 2 deletions.
26 changes: 25 additions & 1 deletion _includes/navheader.html
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,30 @@
{%- if site.data.sitetext[page.lang].header.text -%}
<div class="intro-heading text-uppercase">{{ site.data.sitetext[page.lang].header.text | markdownify }}</div>
{%- endif -%}

<div style="font-size: 20px;margin-bottom: 20px; display: flex;">
<div style="margin-left: auto;margin-right: auto;border-left: 2px solid white;border-right: 2px solid white;padding-left: 10px;padding-right: 10px;">
<i class="fas fa-bullhorn"></i>
{% if page.lang == "fr" %}
{% assign frPosts = site.posts | where: 'lang', 'fr' %}
{% for post in frPosts limit:1 %}
<span><i>{{ post.date | date: "Dernière news le %-d %B %Y" }} :</i></span>
<br>
<a href="{{ post.url }}" style="color: white;"><i class="fas fa-sign-in-alt"></i> {{ post.title }}</a>
{% endfor %}
{% endif %}

{% if page.lang == "en" %}
{% assign enPosts = site.posts | where: 'lang', 'en' %}
{% for post in enPosts limit:1 %}
<span><i>{{ post.date | date: "The last news on %-d %B %Y" }}:</i></span>
<br>
<a href="{{ post.url }}" style="color: white;"><i class="fas fa-sign-in-alt"></i> {{ post.title }}</a>
{% endfor %}
{% endif %}
</div>
</div>

{%- if site.data.sitetext[page.lang].header.button -%}
<a class="btn-header btn btn-primary btn-xl text-uppercase js-scroll-trigger" href="{{ site.data.sitetext[page.lang].header.buttonlink }}">{{ site.data.sitetext[page.lang].header.button }}</a>
{%- endif -%}
Expand All @@ -77,4 +101,4 @@
</header>
{% endif %}

<!-- End Header -->
<!-- End Header -->
2 changes: 1 addition & 1 deletion _sass/layout/_masthead.scss
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ header.masthead {
font-size: 42px;
font-weight: 700;
line-height: 75px;
margin-bottom: 50px;
margin-bottom: 20px;
@include heading-font;
}
}
Expand Down

0 comments on commit 895ecfe

Please sign in to comment.