new.sh: remove slash of string title

This commit is contained in:
Jesús 2020-05-03 15:11:49 -05:00
parent a8f3ceb8bf
commit 64c731759f
No known key found for this signature in database
GPG Key ID: F6EE7BC59A315766

4
new.sh
View File

@ -13,6 +13,8 @@ printf '%s' "Enter Category: "
read -r read -r
category="$REPLY" category="$REPLY"
title="${title/\//}"
# Slug | lowercase, without accent mark # Slug | lowercase, without accent mark
lug=$(printf '%s' "${title// /-}") lug=$(printf '%s' "${title// /-}")
slug=$(echo "$lug" | sed 'y/áÁàÀãÃâÂéÉêÊíÍóÓõÕôÔúÚñÑçÇ/aAaAaAaAeEeEiIoOoOoOuUnNcC/' | sed -e 's/\(.*\)/\L\1/') slug=$(echo "$lug" | sed 'y/áÁàÀãÃâÂéÉêÊíÍóÓõÕôÔúÚñÑçÇ/aAaAaAaAeEeEiIoOoOoOuUnNcC/' | sed -e 's/\(.*\)/\L\1/')
@ -35,4 +37,4 @@ printf '%s\n%s\n%s\n%s\n%s\n%s\n' "$o_author"\
"$o_date"\ "$o_date"\
"$o_slug"\ "$o_slug"\
"$o_tag"\ "$o_tag"\
"$o_title" > "content/$slug.md" "$o_title" > "content/articles/$slug.md"