From 45f9f782f52344f16c78de36acf70f2481418eb8 Mon Sep 17 00:00:00 2001 From: "Uwe Jandt (DESY)" <uwe.jandt@desy.de> Date: Wed, 14 Apr 2021 15:11:12 +0200 Subject: [PATCH] switch events and news on frontpage --- _layouts/frontpage.html | 71 ++++++++++++++++++++--------------------- 1 file changed, 35 insertions(+), 36 deletions(-) diff --git a/_layouts/frontpage.html b/_layouts/frontpage.html index 8bdd06e10..80235f3df 100644 --- a/_layouts/frontpage.html +++ b/_layouts/frontpage.html @@ -58,6 +58,41 @@ --> <section> <div class="info-col"> + <div class="frontpage-jumbotron"> + <h1><a href="{{ 'events' | relative_url }}"><i class="far fa-calendar-alt" aria-hidden="true"></i> Events</a></h1> + <div class="flex-content-wrapper"> + {% assign sorted_events = site.events | sort: "start.date" %} + {% assign today = "now" | date: "%Y-%m-%d" %} + {% assign has_upcoming_events = false %} + {% for event in sorted_events %} + {% if event.start.date < today or + event.registration_period.to < today %} + {% continue %} + {% else %} + {% assign has_upcoming_events = true %} + {% endif %} + {% include frontpage/event-card.html + title = event.excerpt %} + {% assign events_counter = events_counter|plus:1 %} + {% if events_counter >= 3 %} + {% break %} + {% endif %} + {% endfor %} + {% if has_upcoming_events == false %} + <article class="list-entry"> + <h1> + There are no upcoming events right now ... stay tuned. + </h1> + </article> + {% endif %} + </div> + <a href="{{ 'events' | relative_url }}" class="btn btn-outline-secondary">All Events</a> + <a class="btn btn-outline-secondary" href="{{ '/feed/events.xml' | relative_url }}" + title="Subscribe to HIFIS Events Feed" + type="application/atom+xml" + download> + Events Feed <i class="fas fa-rss"></i></a> + </div> <div class="frontpage-jumbotron"> {% if page.notification.description and page.notification.title %} {% include frontpage/notification.html @@ -95,42 +130,6 @@ download> News Feed <i class="fas fa-rss"></i></a> </div> - - <div class="frontpage-jumbotron"> - <h1><a href="{{ 'events' | relative_url }}"><i class="far fa-calendar-alt" aria-hidden="true"></i> Events</a></h1> - <div class="flex-content-wrapper"> - {% assign sorted_events = site.events | sort: "start.date" %} - {% assign today = "now" | date: "%Y-%m-%d" %} - {% assign has_upcoming_events = false %} - {% for event in sorted_events %} - {% if event.start.date < today or - event.registration_period.to < today %} - {% continue %} - {% else %} - {% assign has_upcoming_events = true %} - {% endif %} - {% include frontpage/event-card.html - title = event.excerpt %} - {% assign events_counter = events_counter|plus:1 %} - {% if events_counter >= 3 %} - {% break %} - {% endif %} - {% endfor %} - {% if has_upcoming_events == false %} - <article class="list-entry"> - <h1> - There are no upcoming events right now ... stay tuned. - </h1> - </article> - {% endif %} - </div> - <a href="{{ 'events' | relative_url }}" class="btn btn-outline-secondary">All Events</a> - <a class="btn btn-outline-secondary" href="{{ '/feed/events.xml' | relative_url }}" - title="Subscribe to HIFIS Events Feed" - type="application/atom+xml" - download> - Events Feed <i class="fas fa-rss"></i></a> - </div> </div> </section> -- GitLab