From 59684496a21d584e58386bc53f6f18f912f1a59b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stig-=C3=98rjan=20Smelror?= Date: Tue, 30 Jan 2024 15:12:52 +0100 Subject: [PATCH] Working on _blog_idx_for_index --- qsgen2 | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/qsgen2 b/qsgen2 index 3f83566..ebdea71 100755 --- a/qsgen2 +++ b/qsgen2 @@ -492,9 +492,9 @@ function _blogs() { BLOG_META_STR_ARRAY=() # Iterate over make_blog_array - for blog in "${#make_blog_array[@]}" + for blog_to_index in "${#make_blog_array[@]}" do - local content="$(<"${blog}")" + #local index_content="$(<"${blog_to_index}")" #sdate=( $( echo ${content} | grep DATE | sed "s|DATE\ ||" | sed "s|\-|\ |g" ) ) #btitle=$( echo ${content} | grep BLOG_TITLE | cut -d' ' -f2- ) #ingress=$( echo ${content} | sed "s/'/\\\'/g" | xargs | grep -Po "#INGRESS_START\K(.*?)#INGRESS_STOP" | sed "s|\ \#INGRESS_STOP||" | sed "s|^\ ||" ) @@ -503,7 +503,7 @@ function _blogs() { #blog_dir="/blog/${sdate[2]}/${sdate[3]:l}/${sdate[4]}" #blog_url="${blog_dir}/${blog_index}.html" - if ${debug}; then echo "_blogs: Adding data for ${blog} to array"; fi + if ${debug}; then echo "_blogs: Adding data for ${blog_to_index} to array"; fi # Concatenate all metadata into a single string for the current blog local metadata_str="SDATE: ${sdate[@]}||BTITLE: ${btitle}||INGRESS: ${ingress}||URL: ${blog_url}" @@ -511,12 +511,11 @@ function _blogs() { # Append this metadata string to the array BLOG_META_STR_ARRAY+=("${metadata_str}") done - - done - # Now BLOG_META_STR_ARRAY contains the metadata string for each blog post export BLOG_META_STR_ARRAY + + done #fi