From 381bff129b70471e86e99a2d6b6a7e090f13287e Mon Sep 17 00:00:00 2001 From: Jefferson Julio Date: Sun, 30 May 2021 22:53:32 -0300 Subject: Better article parsing, support for article code parsing (add line numbers to code blocks) --- pages/home.sh | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) (limited to 'pages/home.sh') 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 } -- cgit v1.2.3