<div class="hero-body">
<div class="container">
<h4 class="title is-4">
- <span class="icon-text">
- <span>
- {{ _("Recent News") }}
- </span>
+ <a class="has-text-inherit" href="/blog">
+ {{ _("Recent News From The IPFire Blog") }}
+ </a>
+ </h4>
+
+ <div class="buttons are-small">
+ {# Show a button to subscribe if users are not subscribed, yet #}
+ {% if not current_user or not current_user.consents_to_promotional_emails %}
+ <a class="button is-light" href="/subscribe">
+ <span class="icon">
+ <i class="fa-solid fa-envelope"></i>
+ </span>
+ <span>
+ {{ _("Subscribe to our Newsletter") }}
+ </span>
+ </a>
+ {% end %}
+ {# Always show a button to subscribe to the RSS feed #}
+ <a class="button is-light" href="/blog/feed.xml">
<span class="icon">
- <a href="/blog/feed.xml" title="{{ _("RSS Feed") }}">
- <i class="fas fa-rss"></i>
- </a>
+ <i class="fas fa-rss"></i>
</span>
- </span>
- </h4>
+ <span>
+ {{ _("Subscribe to our RSS Feed") }}
+ </span>
+ </a>
+ </div>
{# List the most recent posts #}
- {% for post in posts %}
+ {% for i, post in enumerate(posts) %}
<div class="block">
- <h5 class="title is-5">
- <a href="/blog/{{ post.slug }}">
- {{ post.title }}
- </a>
- </h5>
- <h6 class="subtitle is-6">
- <small class="has-text-grey">
- {{ locale.format_date(post.published_at, shorter=True) }}
-
- {% if post.author %}
- {{ _("by %s") % post.author }}
- {% end %}
- </small>
- </h6>
-
- <div class="content">
- {{ post.excerpt }}
- </div>
+ {# Highlight the first three posts #}
+ {% if i < 3 %}
+ <h5 class="title is-5">
+ <a href="/blog/{{ post.slug }}">
+ {{ post.title }}
+ </a>
+ </h5>
+
+ <h6 class="subtitle is-6">
+ <small class="has-text-grey">
+ {{ locale.format_date(post.published_at, shorter=True) }}
+
+ {% if post.author %}
+ {{ _("by %s") % post.author }}
+ {% end %}
+ </small>
+ </h6>
+
+ {# Show the first couple of lines for the first three posts #}
+ <div class="content">
+ {{ post.excerpt }}
+ </div>
+
+ {# All other posts will just get a headline #}
+ {% else %}
+ <h6 class="title is-6">
+ <a href="/blog/{{ post.slug }}">
+ {{ post.title }}
+ </a>
+ </h6>
+
+ <h6 class="subtitle is-6">
+ <small class="has-text-grey">
+ {{ locale.format_date(post.published_at, shorter=True) }}
+
+ {% if post.author %}
+ {{ _("by %s") % post.author }}
+ {% end %}
+ </small>
+ </h6>
+ {% end %}
</div>
{% end %}
-
- <a class="button is-text is-fullwidth" href="/blog">
- {{ _("Read More On The IPFire Blog") }}
- </a>
</div>
</div>
</section>