From 63634ab89b3994b5319fe2341381370cd814c0aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 10:48:59 +0100 Subject: [PATCH] Use Perl to add to INGRESS in _blogs --- qsgen2 | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/qsgen2 b/qsgen2 index 7e0e2f5..0078b53 100755 --- a/qsgen2 +++ b/qsgen2 @@ -426,8 +426,8 @@ function _blogs() { blog_index="${blog_index//,/}" blog_index="${blog_index//./}" - blog_dir="/blog/${sdate[2]}/${sdate[3]}/${sdate[4]}" - blog_url="${blog_dir}/${blog_index}.html" + blog_dir="/blog/${sdate[2]}/${sdate[3]:l}/${sdate[4]}" + blog_url="${blog_dir}/${blog_index:l}.html" # Regular blog creation process if [[ ! ${mode} ]]; then @@ -444,7 +444,9 @@ function _blogs() { blog_content="${blog_content//CALMONTH/${sdate[3]}}" blog_content="${blog_content//CALYEAR/${sdate[2]}}" blog_content="${blog_content//BLOGURL/${blog_url}}" - blog_content="${blog_content//INGRESS/${ingress}}" + # Replace INGRESS placeholder with actual content using Perl + blog_content=$(echo "${blog_content}" | perl -pe "s|\QINGRESS\E|${ingress}|g") + # blog_content="${blog_content//INGRESS/${ingress}}" # Replace BODY placeholder with actual content using Perl blog_content=$(echo "${blog_content}" | perl -pe "s|\QBODY\E|${body}|g")