kloeckner.com.ar

a backup of my entire webpage
Index Commits Files Refs README LICENSE
commit 11e5c0315e6a4532e5e804fe8097c9731d4903a1
parent cc1be4cd3a2e1563167b6a8504ce8959f21d79fa
Author: mjkloeckner <martinjkloeckner@gmail.com>
Date:   Sat, 17 Feb 2024 21:45:59 -0300

Remove old code and make indentation uniform

Diffstat:
Mscripts/build_page.sh | 4----
Mscripts/sync.sh | 26+++++++++++++-------------
2 files changed, 13 insertions(+), 17 deletions(-)
diff --git a/scripts/build_page.sh b/scripts/build_page.sh
@@ -67,12 +67,8 @@ last_update="$(date -r $input '+%d-%b-%Y')"
 
 mkdir -p $dest_dir &> /dev/null
 
-# echo "file: $input"
-# echo "filename: $filename"
 echo "title: $title"
 echo "date: $date"
-# echo "dest dir: $dest_dir"
-# echo "template: $template"
 
 [ -z "$title" ] || [ -z "$date" ] \
     && echo "error: no metadata found on file $input" && exit 1
diff --git a/scripts/sync.sh b/scripts/sync.sh
@@ -11,9 +11,9 @@ index_latest_uploads_count=6
 
 generate_blog_index() {
     update=false
-    for i in $(ls $root_folder/$blog_folder); do
+    for i in $(ls $root_folder/$blog_folder); do
         # if exists and it's a directory
-        if [ -d $root_folder/$blog_folder/$i ]; then
+        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")
 
@@ -24,8 +24,8 @@ generate_blog_index() {
                 update=true
                 break
             fi
-        fi
-    done
+        fi
+    done
 
     $update || echo "     └─ Blog index file up to date" && return 1
 
@@ -89,20 +89,20 @@ generate_rss_feed() {
         echo "$article_date"
         echo "</item>" >> $rss_feed_file
         echo "" >> $rss_feed_file
-    done
+    done
 
-    # Close the RSS feed file
-    echo "" >> $rss_feed_file
-    echo "</channel>" >> $rss_feed_file
-    echo "</rss>" >> $rss_feed_file
+    # Close the RSS feed file
+    echo "" >> $rss_feed_file
+    echo "</channel>" >> $rss_feed_file
+    echo "</rss>" >> $rss_feed_file
 }
 
 check_rss_feed_last_build() {
     [ ! -e $rss_feed_file ] && echo "+ Regenerating rss feed" && generate_rss_feed && return
     updated=false
-    for i in $(ls $root_folder/$blog_folder); do
+    for i in $(ls $root_folder/$blog_folder); do
         # if exists and it's a directory
-        if [ -d $root_folder/$blog_folder/$i ]; then
+        if [ -d $root_folder/$blog_folder/$i ]; then
             last_modified=$(stat $root_folder/$blog_folder/$i/$i.md --format "%Y")
             rss_file_date=$(stat $rss_feed_file --format "%Y")
 
@@ -113,8 +113,8 @@ check_rss_feed_last_build() {
                 generate_rss_feed && updated=true
                 break
             fi
-        fi
-    done
+        fi
+    done
     $updated || echo "     └─ Rss feed file up to date" && echo ""
 }