mirror of
https://github.com/Matir/skel.git
synced 2026-05-26 13:35:42 -07:00
More improvements in slugs.
This commit is contained in:
@@ -74,7 +74,12 @@ 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 -|sed 's/^-*\([^-].*[^-]\)-*$/\1/')
|
||||
SLUG=$(echo -n ${TITLE} |
|
||||
tr A-Z a-z | # Everything in lower case
|
||||
tr -d "'" | # Remove single quotes entirely
|
||||
tr -c -s -- a-z0-9 - | # Replace non-alphanums with dashes
|
||||
sed 's/^-*\([^-].*[^-]\)-*$/\1/' # Remove leading and trailing slashes
|
||||
)
|
||||
DATE=`date +%Y-%m-%d`
|
||||
|
||||
case "${1:-help}" in
|
||||
|
||||
Reference in New Issue
Block a user