Avoid leading and trailing dashes in blog post slugs.

This commit is contained in:
David Tomaschik
2018-04-07 13:58:02 +02:00
parent a9012bebea
commit c8b33e39c7

View File

@@ -73,7 +73,7 @@ function jekyll {
JTEMPLATE+="category: Blog\n"
JTEMPLATE+="---\n\n"
TITLE=${@[2,-1]}
SLUG=$(echo -n ${TITLE}|tr A-Z a-z|tr -c -s -- a-z0-9 -)
SLUG=$(echo -n ${TITLE}|tr A-Z a-z|tr -c -s -- a-z0-9 -|sed 's/^-*\([^-].*[^-]\)-*$/\1/')
DATE=`date +%Y-%m-%d`
case "${1:-help}" in