diff --git a/scripts/mkdraft.sh b/scripts/mkdraft.sh index 1ed0952..2cf5c15 100755 --- a/scripts/mkdraft.sh +++ b/scripts/mkdraft.sh @@ -16,7 +16,7 @@ function yes_or_no { } title="$@" -path="src/posts/drafts/$(date +%F)-$(echo -n $title | tr 'A-Z' 'a-z' | tr -c '[:alnum:]' -).md" +path="src/posts/drafts/$(date +%F)-$(echo -n $title | tr 'A-Z' 'a-z' | tr -c '[:alnum:]' - | sed -E 's|-+|-|g').md" if [ -f $path ]; then yes_or_no "$path already exists! Do you want to overwrite it?" || exit