Merge branch 'master' of github.com:cfenollosa/bashblog
This commit is contained in:
commit
549805d9e3
1 changed files with 4 additions and 3 deletions
7
bb.sh
7
bb.sh
|
@ -368,7 +368,7 @@ create_html_page() {
|
||||||
echo '<!-- entry begin -->' >> "$filename" # marks the beginning of the whole post
|
echo '<!-- entry begin -->' >> "$filename" # marks the beginning of the whole post
|
||||||
echo '<h3><a class="ablack" href="'$global_url/$file_url'">' >> "$filename"
|
echo '<h3><a class="ablack" href="'$global_url/$file_url'">' >> "$filename"
|
||||||
# remove possible <p>'s on the title because of markdown conversion
|
# remove possible <p>'s on the title because of markdown conversion
|
||||||
echo "$(echo "$title" | sed 's/\<\/*p\>//g')" >> "$filename"
|
echo "$(echo "$title" | sed 's/<\/*p>//g')" >> "$filename"
|
||||||
echo '</a></h3>' >> "$filename"
|
echo '</a></h3>' >> "$filename"
|
||||||
if [[ "$timestamp" == "" ]]; then
|
if [[ "$timestamp" == "" ]]; then
|
||||||
echo '<div class="subtitle">'$(LC_ALL=$date_locale date +"$date_format")' — ' >> "$filename"
|
echo '<div class="subtitle">'$(LC_ALL=$date_locale date +"$date_format")' — ' >> "$filename"
|
||||||
|
@ -407,9 +407,10 @@ parse_file() {
|
||||||
title=""
|
title=""
|
||||||
while read line; do
|
while read line; do
|
||||||
if [[ "$title" == "" ]]; then
|
if [[ "$title" == "" ]]; then
|
||||||
title="$line"
|
# set title and
|
||||||
# remove extra <p> and </p> added by markdown
|
# remove extra <p> and </p> added by markdown
|
||||||
filename="$(echo $title | sed 's/\<\/*p\>//g' | tr [:upper:] [:lower:])"
|
title=$(echo "$line" | sed 's/<\/*p>//g')
|
||||||
|
filename="$(echo $title | tr [:upper:] [:lower:])"
|
||||||
filename="$(echo $filename | sed 's/\ /-/g')"
|
filename="$(echo $filename | sed 's/\ /-/g')"
|
||||||
filename="$(echo $filename | tr -dc '[:alnum:]-')" # html likes alphanumeric
|
filename="$(echo $filename | tr -dc '[:alnum:]-')" # html likes alphanumeric
|
||||||
filename="$filename.html"
|
filename="$filename.html"
|
||||||
|
|
Loading…
Add table
Reference in a new issue