[gtk-web/ebassi/stable-tag: 1/2] Improve filters for stable/unstable/oldstable tags




commit 92c1a42f69467bd2626d202624fcf9dbcacb568f
Author: Emmanuele Bassi <ebassi gnome org>
Date:   Tue Jan 18 17:34:54 2022 +0000

    Improve filters for stable/unstable/oldstable tags
    
    We should use proper filters instead of simply getting the
    first element in the array.
    
    Additionally, for unstable tags we should conditionally show
    the whole block, in case we haven't branched yet.

 _pages/index.html | 14 ++++++++------
 1 file changed, 8 insertions(+), 6 deletions(-)
---
diff --git a/_pages/index.html b/_pages/index.html
index 8d071ea..f51e58e 100644
--- a/_pages/index.html
+++ b/_pages/index.html
@@ -103,12 +103,14 @@ news_and_events_list:
           </div>
         </div><!-- dropdown-->
         <div>
-          {% assign latest_tag = site.data.api_fetch.stable_tags[0] %}
-          <span class="text-light"><span class="small text-info">Latest stable</span> v{{ latest_tag.name 
}}</span><br/>
-          {% assign latest_unstable_tag = site.data.api_fetch.unstable_tags[0] %}
-          <span class="text-light"><span class="small text-info">Latest unstable</span> v{{ 
latest_unstable_tag.name }}</span><br/>
-          {% assign latest_old_tag = site.data.api_fetch.old_stable_tags[0] %}
-          <span class="text-light"><span class="small text-info">Latest old stable</span> v{{ 
latest_old_tag.name }}</span><br/>
+          {% assign latest_tag = site.data.api_fetch.stable_tags | first %}
+          <span class="text-light"><span class="small text-info">Latest stable</span> {{ latest_tag.name 
}}</span><br/>
+          {% assign latest_unstable_tag = site.data.api_fetch.unstable_tags | first %}
+          {% if latest_unstable_tag %}
+          <span class="text-light"><span class="small text-info">Latest unstable</span> {{ 
latest_unstable_tag.name }}</span><br/>
+          {% endif %}
+          {% assign latest_old_tag = site.data.api_fetch.old_stable_tags | first %}
+          <span class="text-light"><span class="small text-info">Latest old stable</span> {{ 
latest_old_tag.name }}</span><br/>
         </div>
       </div>
       <div class="col-lg-6 d-flex justify-content-center align-items-center">


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]