diff options
Diffstat (limited to 'pages/home.sh')
-rwxr-xr-x | pages/home.sh | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/pages/home.sh b/pages/home.sh index c9a9966..02adf53 100755 --- a/pages/home.sh +++ b/pages/home.sh @@ -13,8 +13,19 @@ WELCOME print-all-articles () { # Find all articles and sort by date of creation - for i in $(find $ARTICLES_PATH -type f -name '*.txt' -printf "%T@ %p\n" | sort -rn | cut -b 23-); do - ARTICLE_FILE="${i/* /}" source $SCRIPT_DIR/components/post-preview.sh + IFS=';' read -ra ARTICLE_LIST <<< "$( + find $ARTICLES_PATH \ + -type f \ + -name '*.txt' \ + -printf "%T@ %p\n" | + sort -rn | + cut -b 23- | + sed 's/^ //g' | + tr '\n' ';' + )" + + for i in "${ARTICLE_LIST[@]}"; do + ARTICLE_FILE="$i" source $SCRIPT_DIR/components/post-preview.sh done } |