listing_format="<a href=\"posts/<!--title-nospaces-->.html\"><!--title--></a> by <!--author--> on <!--date-->" # rejig this and/or remove elements to taste. You may need to change delimeter when sed is used on this later if any of the fields contain slashes
author=$(echo "$meta" | sed -n 's/^author:\s\?\(.*\)$/\1/p')
if [[ -z "$author" ]]; then
author=$default_author
fi
echo "Making \"$title\""
pandoc $file > "$temp"/post
sed "/<!--post-->/r $temp/post" "$blogdir/post_template.html" | sed '/<!--post-->/d' | sed "s/<!--author-->/$author/g" | sed "s/<!--date-->/$date/g" | sed "s/<!--title-->/$title/g" > "$blogdir/posts/$title_nospaces.html"
sed "/<!--post list-->/r $temp/list" "$blogdir/index_template.html" | sed '/<!--post list-->/d' > "$blogdir/index.html"
echo "Creating RSS"
sed "/<!--rss-->/r $temp/rss" "$blogdir/rss_template.xml" | sed "s@<!--url-->@$url@g" | sed '/<!--rss-->/d' > "$blogdir/rss.xml" # we use @ as delimeter here because replacement text contains slashes. If your sites url contains an @ for some reason, use a delimeter that doesn't appear in the url