# " --> " # & --> & # ' --> ' # < --> < # > --> > content="$(./hoedown "$1" | tail -n +2 | sed 's//\>\;/g')" title=$(cat "$1" | head -n 1 | sed 's/# //' | sed -e 's/\r//g') file=$(printf "$1" | sed 's/\.md$//' | sed 's/^\.\///') config=$(cat ./config.txt) url=$(printf "$config" | awk 'gsub(/^url:/,"")'); prime_folder=$(printf "$config" | awk 'gsub(/^prime_folder:/,"")'); post=$(printf "$config" | awk 'gsub(/^post:/,"")'); ftp=$(printf "$config" | awk 'gsub(/^ftp:/,"")'); user=$(printf "$config" | awk 'gsub(/^user:/,"")'); #f_end="$(cat ./$prime_folder/$post/index.xml | tail -n 2)" #f_start=$(cat ./$prime_folder/$post/index.xml | awk -v RS="$f_end" 'NR==1{printf $0} NR!=1{printf "%s", $0}') f_start=$(head -n 6 "./static/$prime_folder$post/index.xml") f_end=$(tail -n +7 "./static/$prime_folder$post/index.xml") pub_date=$(date '+%a, %d %b %Y %H:%M:%S %z') f_out=$(printf "$f_start\n\n\t$title\n\t$pub_date\n\t$url/$prime_folder$post/$file/\n\t$url/$prime_folder$post/$file/\n\t$content\n\n$f_end" | awk -v chunk="$(date '+%B %d/%d/%Y %I:%M%p')" '{gsub("<DATE_POST>",chunk)}1') printf "$f_out" printf "$f_out" > "static/$prime_folder$post/index.xml"