paritybit.ca

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs | README | LICENSE

commit 7c542e5164571a2da48072f7ddb97f1e2cf365ae
parent 5b42dbc6e93c1c5564ec20ac2a9839c8a93bcc89
Author: Jake Bauer <jbauer@paritybit.ca>
Date:   Mon, 30 Dec 2019 14:03:47 -0500

More bug fixes to sed expressions

Diffstat:
Mcompile | 2+-
Mpublish | 6+++---
2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/compile b/compile @@ -122,7 +122,7 @@ for page in $@; do metaText=$(sed '3!d' "$pagedir"/"$pagename".md | cut -d# -f 2) # Remove leading whitespace and forward slash characters metaTextClean=$(echo -e "${metaText}" | sed -e 's/^[[:space:]]*//') - metaTextClean=$(sed -e 's/\//\\\//' <<< "$metaTextClean") + metaTextClean=$(sed -e 's/\//\\\//g' <<< "$metaTextClean") printf " Setting meta tag..." sed -i "s/content=\"\"/content=${metaTextClean//&/\\&}/" \ "$htmldir"/"$savepath"/"$pagename".html diff --git a/publish b/publish @@ -97,7 +97,7 @@ elif [ $publishProject ]; then metaText=$(sed '3!d' pages/"$basePage"/"$filename".md | cut -d# -f 2) # Remove leading whitespace, surrounding quotes, forward slash characters metaTextClean=$(echo -e "${metaText}" | sed -e 's/^[[:space:]]*//') - metaTextClean=$(sed -e 's/\//\\\//' <<< "$metaTextClean") + metaTextClean=$(sed -e 's/\//\\\//g' <<< "$metaTextClean") metaTextClean=$(sed -e 's/^"//' -e 's/"$//' <<< "$metaTextClean") sed -i "/<ul>/a \ \ \ \ \<li\>\<a href=\"$basePage\/$filename\"\>$pageTitle\<\/a\>: $metaTextClean\<\/li\>" pages/$basePage.md @@ -175,8 +175,8 @@ tput sgr0 # Update the sitemap printf " Updating sitemap.xml " -baseURLClean=$(sed -e 's/\//\\\//' <<< "$baseURL") -sed -i "/$baseURLClean/a \<url\>\<loc\>$baseURLClean/$filename\<\/loc\>\<\/url\>" public/sitemap.xml +baseURLClean=$(sed -e 's/\//\\\//g' <<< "$baseURL") +sed -i "/$baseURLClean</a \ \ \ \ \ \ \ \<url\>\<loc\>$baseURLClean\/$filename\<\/loc\>\<\/url\>" public/sitemap.xml tput setaf 2; tput bold echo "[DONE]"