]> git.ipfire.org Git - ipfire.org.git/commitdiff
index: Update the news section master
authorMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Jan 2026 11:05:17 +0000 (11:05 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Fri, 16 Jan 2026 11:05:17 +0000 (11:05 +0000)
This will give some more information and make it clearer that there is
an RSS feed as well as a newsletter to subscribe to.

Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/templates/index.html
src/web/handlers.py

index 2d0b2c9744551e8fd23946b9f28b3003c2a3732c..95a47d6bd84da93d9b47f1e05e8633f8c80ad90f 100644 (file)
                <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>
index 46eac77e12f08496dd7d389e29495da0f7265dfd..e471502a3d9a8a136736cb3cc0cd4456ca6aedcd 100644 (file)
@@ -11,7 +11,7 @@ class IndexHandler(base.AnalyticsMixin, base.BaseHandler):
                latest_release = self.releases.get_latest()
 
                # Fetch the latest blog posts
-               posts = self.backend.blog.get_newest(limit=2)
+               posts = self.backend.blog.get_newest(limit=10)
 
                self.render("index.html", latest_release=latest_release, posts=posts)