From 4afa2c2d5a47891c785a79dde17885db24a5a3ba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Thu, 8 Feb 2024 07:57:14 +0100 Subject: [PATCH] Update qsgen2 to version 0.3.4 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit • Updated the VERSION variable from 0.3.3 to 0.3.4 • Added a check for the DATE metadata in the blog file • If the DATE metadata is missing, the script will skip the file and move to the next These changes ensure that the script properly handles the DATE metadata in the blog files and prevents any issues caused by missing metadata. --- qsgen2 | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qsgen2 b/qsgen2 index 29521ef..87a6c69 100755 --- a/qsgen2 +++ b/qsgen2 @@ -10,7 +10,7 @@ # https://github.com/kekePower/qsgen2/ # -VERSION="0.3.3" # Mon-2024-02-05 +VERSION="0.3.4" # Thu-2024-02-08 QSGEN="Quick Site Generator 2" # Set to true or false @@ -639,6 +639,12 @@ function _blogs() { local content="$(<"${blog}")" local sdate btitle ingress body blog_index blog_dir blog_url + + # Check for the DATE line + if ! echo "$content" | grep -q "^DATE "; then + _msg debug "_blogs: DATE metadata missing in ${blog}." + continue # Skip this file and move to the next + fi # Extract blog information sed -i "s/GETDATE/${blogdate}/" ${blog}