Working on _blog_idx_for_index

This commit is contained in:
Stig-Ørjan Smelror 2024-01-30 15:08:26 +01:00
parent 3c6c8bae90
commit d3d9ca51b8

14
qsgen2
View File

@ -496,13 +496,13 @@ function _blogs() {
for blog in "${#make_blog_array[@]}"
do
local content="$(<"${blog}")"
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|^\ ||" )
blog_index="${btitle:l}"
blog_index=$(echo "${blog_index}" | sed 's/ /_/g; s/,//g; s/\.//g; s/://g; s/[()]//g')
blog_dir="/blog/${sdate[2]}/${sdate[3]:l}/${sdate[4]}"
blog_url="${blog_dir}/${blog_index}.html"
#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|^\ ||" )
#blog_index="${btitle:l}"
#blog_index=$(echo "${blog_index}" | sed 's/ /_/g; s/,//g; s/\.//g; s/://g; s/[()]//g')
#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