Update qsgen2 to version 0.3.4

• 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.
This commit is contained in:
Stig-Ørjan Smelror 2024-02-08 07:57:14 +01:00
parent 75b98cc2e3
commit 4afa2c2d5a

8
qsgen2
View File

@ -10,7 +10,7 @@
# https://github.com/kekePower/qsgen2/ # 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" QSGEN="Quick Site Generator 2"
# Set to true or false # Set to true or false
@ -640,6 +640,12 @@ function _blogs() {
local content="$(<"${blog}")" local content="$(<"${blog}")"
local sdate btitle ingress body blog_index blog_dir blog_url 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 # Extract blog information
sed -i "s/GETDATE/${blogdate}/" ${blog} sed -i "s/GETDATE/${blogdate}/" ${blog}
# Array sdate = Name day=1, Year=2, Month=3, Number day=4 # Array sdate = Name day=1, Year=2, Month=3, Number day=4