From b89e8de06f59f45c4ee2eac037424b03670d6c53 Mon Sep 17 00:00:00 2001 From: simonpetit Date: Thu, 4 Dec 2025 15:54:52 +0000 Subject: [PATCH] WIP to add creation date + update date --- bob | 60 +++++++++++++++++++++++++++++++++++++++++++----------------- 1 file changed, 43 insertions(+), 17 deletions(-) diff --git a/bob b/bob index 36ad4c8..d503dbb 100755 --- a/bob +++ b/bob @@ -27,7 +27,6 @@ usage() echo " unpublish unpublish the post" } - init() { echo Name of the author of the blog : @@ -58,29 +57,55 @@ init() update_index() { - # Listing all posts and making an html list (with there link) out of them - posts=$(ls -t ./posts | awk ' - BEGIN { - print "" }' + ) # retrieving the template for the index.html template="${BOB_LIB}/template/index.html" - # replacing {{articles}} in the template with the actual list of articles from above - awk -v content="$posts" '{gsub(/{{articles}}/, content); print}' "$template" > "./index.html" - + awk -v articles="$sorted_posts" ' + { + gsub(/{{articles}}/, articles); + print + }' "$template" > "./index.html" } + publish() { # Storing the path of the post/article to publish @@ -194,3 +219,4 @@ elif [[ "$1" == "deploy" ]]; then elif [[ "$1" == "help" ]]; then usage fi +