diff --git a/user-bin/newpost b/user-bin/newpost index ecfdff0..f0eba5b 100644 --- a/user-bin/newpost +++ b/user-bin/newpost @@ -3,12 +3,12 @@ if [ $# -gt 0 ]; then filename=_posts/$(date +%Y-%m-%d-) # Replace all the special characters with a hyphen filename+=${*//[^a-zA-Z0-9_]/-}.md - filename=$(echo "$filename" | tr '[:upper:]' '[:lower:]' | sed 's/-\{2,\}/-/g') + filename=$(echo "$filename" | tr '[:upper:]' '[:lower:]' | sed 's/-\{2,\}/-/g' | sed 's/-\.md$/.md/') if [ ! -f "$filename" ]; then cat >"$filename" <