hugosoucycc

[ARCHIVED] Another old source code of <hugo.soucy.cc>.
Log | Files | Refs | Submodules

commit 2dba8759d5f49579cca7cf5e39afb8c13b02c2e9
parent 7f37140754419cdb788b91adb8ca94f2fbf2bb9c
Author: Hugo Soucy <hugo@soucy.cc>
Date:   Mon, 11 Sep 2017 13:41:45 -0400

Using Perl because `stat` and `date` are not the same in OpenBSD and GNU/Linux

Diffstat:
Mfunctions/create-html-pages | 5+++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/functions/create-html-pages b/functions/create-html-pages @@ -44,7 +44,8 @@ create_html_pages () { local page_title="$title" local date="$date" local datetime="$datetime" - local modified="$(date -r "$markdown" +%Y-%m-%dT%H:%M:%S)" + # Using Perl because `stat` and `date` are not the same in OpenBSD and GNU/Linux + local modified="$(perl -MPOSIX -e 'print POSIX::strftime "%Y-%m-%dT%H:%M:%S", localtime((stat $ARGV[0])[9])' $markdown)" local templatename="$template" local permalink="$BASE_URL${page_path%.*}.html" local description_loc="$description" @@ -66,7 +67,7 @@ create_html_pages () { fi echo "$date|$datetime|$BASE_URL${page_path%.*}.html|$page_title|$page_id" - done | sort -nr -o "$FAKESTACHE_PATH"/"$DB" + done | sort -nr -o "$FAKESTACHE_PATH"/"$DB" } create_homepage