Fixed library functions
This commit is contained in:
parent
b70ebe381d
commit
7f639646b8
@ -7,7 +7,7 @@ function get_blog_pages () {
|
|||||||
|
|
||||||
## Setting the list to the available blog files.
|
## Setting the list to the available blog files.
|
||||||
if ls -1 $BLOG_DIR/*.wiki >/dev/null 2>&1; then
|
if ls -1 $BLOG_DIR/*.wiki >/dev/null 2>&1; then
|
||||||
VAR=( $(ls -1 $BLOG_DIR/*.wiki | grep -Ev 'index.wiki|about-me.wiki' ) )
|
VAR=( $(ls -r1 $BLOG_DIR/*.wiki | grep -Ev 'index.wiki|about-me.wiki' ) )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -35,7 +35,7 @@ for page in ${last_few_posts[@]}; do
|
|||||||
read JUNK TITLE <<< "$( grep '%title' $page )"
|
read JUNK TITLE <<< "$( grep '%title' $page )"
|
||||||
TITLES="${TITLES}\n - [[$(basename page)|$TITLE]]"
|
TITLES="${TITLES}\n - [[$(basename page)|$TITLE]]"
|
||||||
done
|
done
|
||||||
echo $TITLES
|
echo -e $TITLES
|
||||||
`
|
`
|
||||||
|
|
||||||
*Date:* `date +'%Y/%m/%d'`
|
*Date:* `date +'%Y/%m/%d'`
|
||||||
@ -71,7 +71,7 @@ for file in ${blog_files[@]}; do
|
|||||||
FILENAME="$(basename $file)"
|
FILENAME="$(basename $file)"
|
||||||
DATE="$(grep -i 'date:' $file | grep -Eo '[0-9]{4}/[0-9]{2}/[0-9]{2}')"
|
DATE="$(grep -i 'date:' $file | grep -Eo '[0-9]{4}/[0-9]{2}/[0-9]{2}')"
|
||||||
|
|
||||||
echo -e "- [[$FILENAME|$TITLE ($DATE)]] \n"
|
echo -e "- [[$FILENAME|$DATE - $TITLE ]] \n"
|
||||||
done
|
done
|
||||||
`
|
`
|
||||||
|
|
||||||
|
@ -25,9 +25,10 @@ while [[ $# -ne 0 ]]; do
|
|||||||
$1 = Title
|
$1 = Title
|
||||||
$2 = Filename
|
$2 = Filename
|
||||||
"
|
"
|
||||||
|
DATESTAMP=`date +%s`
|
||||||
TITLE="${1:?"main.sh : Title was not provided"}"
|
TITLE="${1:?"main.sh : Title was not provided"}"
|
||||||
FILENAME="${2:?"main.sh : Filename was not provided"}"
|
FILENAME="${2:?"main.sh : Filename was not provided"}"
|
||||||
generate_blog_post "$TITLE" "$FILENAME"
|
generate_blog_post "$TITLE" "$DATESTAMP-$FILENAME"
|
||||||
sync
|
sync
|
||||||
generate_index
|
generate_index
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user