From 3f1c339cd8eaba7c374773f8b1e5d438ec33add0 Mon Sep 17 00:00:00 2001 From: Jessica Phoenix Canady Date: Tue, 30 Jan 2024 16:46:16 -0500 Subject: [PATCH] Fix newposts' TOML string quoting and slugification. --- bin/newpost | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/bin/newpost b/bin/newpost index bfd2ef2..0f5b6b1 100755 --- a/bin/newpost +++ b/bin/newpost @@ -5,20 +5,19 @@ set -e cd "$(dirname "$0")/../" TITLE=$1 -SLUG=echo $TITLE | iconv -t ascii//TRANSLIT | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z~ -echo $SLUG -exit +SLUG=$(echo $TITLE | iconv -t ascii//TRANSLIT | sed -r s/[~\^]+//g | sed -r s/[^a-zA-Z0-9]+/-/g | sed -r s/^-+\|-+$//g | tr A-Z a-z) PUBLISH_DATE=$(date --rfc-3339=seconds) FILEPATH="./content/blog/$SLUG.md" if [ ! -e $FILEPATH ]; then cat > $FILEPATH <<-EOF +++ -title = $TITLE +title = "$TITLE" date = $PUBLISH_DATE draft = false [taxonomies] +# these go in quotes, like the title tags = [] +++