From: Michael Tremer Date: Fri, 16 Jan 2026 11:05:17 +0000 (+0000) Subject: index: Update the news section X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=2cbb214385aa3ab508984160f9c0fc1798b24938;p=ipfire.org.git index: Update the news section 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 --- diff --git a/src/templates/index.html b/src/templates/index.html index 2d0b2c97..95a47d6b 100644 --- a/src/templates/index.html +++ b/src/templates/index.html @@ -280,46 +280,81 @@

- - - {{ _("Recent News") }} - + + {{ _("Recent News From The IPFire Blog") }} + +

+ +
+ {# Show a button to subscribe if users are not subscribed, yet #} + {% if not current_user or not current_user.consents_to_promotional_emails %} + + + + + + {{ _("Subscribe to our Newsletter") }} + + + {% end %} + {# Always show a button to subscribe to the RSS feed #} + - - - + - - + + {{ _("Subscribe to our RSS Feed") }} + + +
{# List the most recent posts #} - {% for post in posts %} + {% for i, post in enumerate(posts) %}
-
- - {{ post.title }} - -
-
- - {{ locale.format_date(post.published_at, shorter=True) }} - - {% if post.author %} - {{ _("by %s") % post.author }} - {% end %} - -
- -
- {{ post.excerpt }} -
+ {# Highlight the first three posts #} + {% if i < 3 %} +
+ + {{ post.title }} + +
+ +
+ + {{ locale.format_date(post.published_at, shorter=True) }} + + {% if post.author %} + {{ _("by %s") % post.author }} + {% end %} + +
+ + {# Show the first couple of lines for the first three posts #} +
+ {{ post.excerpt }} +
+ + {# All other posts will just get a headline #} + {% else %} +
+ + {{ post.title }} + +
+ +
+ + {{ locale.format_date(post.published_at, shorter=True) }} + + {% if post.author %} + {{ _("by %s") % post.author }} + {% end %} + +
+ {% end %}
{% end %} - - - {{ _("Read More On The IPFire Blog") }} -
diff --git a/src/web/handlers.py b/src/web/handlers.py index 46eac77e..e471502a 100644 --- a/src/web/handlers.py +++ b/src/web/handlers.py @@ -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)