From 8e8f8bc790421fdb728c1f7f02931c1effb027b2 Mon Sep 17 00:00:00 2001 From: pi Date: Mon, 12 Nov 2018 16:24:34 -0800 Subject: [PATCH] Update postToBlog.sh --- postToBlog.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/postToBlog.sh b/postToBlog.sh index ea5f4a1..3935342 100755 --- a/postToBlog.sh +++ b/postToBlog.sh @@ -27,10 +27,10 @@ do dispUsage "${0##*/} -i [-l] [-T] [-c<categories>] [-t<tags>] [-s<sub-directory>] [-S] [-h]" dispOptionShort "-i" "Input markdown file. The default is '${_mfile}'." dispOptionShort "-l" "Page layout defined in Jekyll's styles. The default is '${_layout}'." - dispOptionShort "-T" "Blog title. The default will use the h1 level title in the input markdown file. The use of this option will overwrite the default. The output filename will use the current date plus the blog title. Note that following symbols in the title will be replaced by the '-' symbol: '!','@','#','$','%','^','&','*','_',':'." + dispOptionShort "-T" "Blog title. The default will use the h1 level title in the input markdown file. The use of this option will overwrite the default. The output filename will use the current date plus the blog title. Note that following symbols in the title will be replaced by the '-' symbol: '.',!','@','#','$','%','^','&','*','_',':'." dispOptionShort "-c" "Blog categories that are separated by commas. The default is/are '${_categories}'." dispOptionShort "-t" "Blog tags that are separated by commas. The default is/are '${_tags}'." - dispOptionShort "-s" "Sub-directory of the posts. The main directory of the posts is placed under '${_posts_address}' folder of your Github.io directory. The default is ${_posts_sub_address}." + dispOptionShort "-s" "Sub-directory of the posts. The main directory of the posts is placed under '${_posts_address}' folder of your Github.io directory. The default is '${_posts_sub_address}'." dispOptionShort "-S" "Save output markdown file. The default will remove the output file after committing the blog to Github." dispOptionShort "-h" "Show help information." exit 0;; @@ -69,7 +69,7 @@ if [[ ${_title} != 'Null' ]]; then exit 1 fi # remove special symbols from the title - _outfile_end=${_title//[:_!@#\$\%\^\&\*]/''} + _outfile_end=${_title//[.:_!@#\$\%\^\&\*]/''} _outfile_end=${_outfile_end// /-} else #读入输入文件输出到临时文件 @@ -92,7 +92,7 @@ else if [[ ${_outfile_end} != 'Null' ]]; then _title=${_outfile_end} # remove special symbols from the h1 title - _outfile_end=${_outfile_end//[:_!@#\$\%\^\&\*]/''} + _outfile_end=${_outfile_end//[.:_!@#\$\%\^\&\*]/''} _outfile_end=${_outfile_end// /-} else printf "\e[1m\e[31mError ==>\e[0m No h1 level title found in: ${_mfile}.\n" @@ -101,7 +101,7 @@ else read _outfile_end _title=${_outfile_end} # remove special symbols from the input title - _outfile_end=${_outfile_end//[:_!@#\$\%\^\&\*]/''} + _outfile_end=${_outfile_end//[.:_!@#\$\%\^\&\*]/''} _outfile_end=${_outfile_end// /-} fi fi