repos/kloeckner.com.ar

Backup of part of my webpage
Commits Files Refs README LICENSE
commit 30df46e10fc9e28475b6d78bc58833ab205a065c
parent 6b456c9ea529c5a4018eaa1184ab96c684094f8d
Author: Martin Kloeckner <mjkloeckner@gmail.com>
Date:   Sat, 29 Aug 2026 12:57:25 -0300

Show 8 entries in latest uploads

Diffstat:
Mindex.html | 2+-
Mscripts/sync.sh | 8++++----
2 files changed, 5 insertions(+), 5 deletions(-)
diff --git a/index.html b/index.html
@@ -29,7 +29,7 @@
 
             <div id=latest-uploads >
                 <div id=latest-uploads-title >
-                    <h2>Latest blog uploads</h2>
+                    <h2>Latest blog posts</h2>
                     <div>
                         <a href="/rss.xml" id="rss"><img style="width: 1.25em;" src="/common/rss_logo.png" alt="rss logo"></a>
                     </div>
diff --git a/scripts/sync.sh b/scripts/sync.sh
@@ -7,16 +7,16 @@ blog_index_file="common/blog_index.shtml"
 latest_uploads_file="common/latest_uploads.shtml"
 rss_feed_file=$root_folder/"rss.xml"   # RSS feed file
 blog_folders=$("$root_folder"/scripts/sort_blog_index.py "$blog_folder")
-index_latest_uploads_count=6
+index_latest_uploads_count=8
 blog_index_need_regen=false
 
 check_if_blog_index_needs_regen() {
     for i in $(ls $root_folder/$blog_folder); do
         if [ -d $root_folder/$blog_folder/$i ]; then
-            last_modified=$(stat "$root_folder/$blog_folder/$i/$i.md" --format "%Y")
-            blog_index_file_date=$(stat "$blog_index_file" --format "%Y")
+            last_modified=$(stat "$root_folder/$blog_folder/$i/$i.md" --format "%Y" 2>/dev/null)
+            blog_index_file_date=$(stat "$blog_index_file" --format "%Y" 2>/dev/null)
 
-            if [ "$last_modified" -gt "$blog_index_file_date" ]
+            if [ -z $last_modified ] || [ -z $blog_index_file_date ] || [ "$last_modified" -gt "$blog_index_file_date" ]
             then
                 echo "     └─ $i.html is newer than $blog_index_file"
                 echo "+ Blog index file needs to be regenerated"