From 015e3b4716a15c674829034bce56b83b323688df Mon Sep 17 00:00:00 2001 From: Zhiming Wang Date: Tue, 5 May 2015 00:19:05 -0700 Subject: convert date metadata field to ISO 8601 --- tools/convert-from-octopress.awk | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) (limited to 'tools') diff --git a/tools/convert-from-octopress.awk b/tools/convert-from-octopress.awk index 20556044..43978df3 100755 --- a/tools/convert-from-octopress.awk +++ b/tools/convert-from-octopress.awk @@ -26,9 +26,18 @@ } else if ($1 == "layout:" || $1 == "comments:" || $1 == "categories:") { next } else if ($1 == "date:") { - print + # Convert + # + # date: 2015-05-03 17:15:49 -0700 + # + # to + # + # date: 2015-05-03T17:15:49-0700 + # date-display: May 3, 2015 + # + # Requires date from coreutils; BSD date doesn't work. + printf "date: %sT%s%s\n", $2, $3, $4 printf "date-display: " - # requires date from coreutils; BSD date doesn't work system("date -d "$2" +'%B %_d, %Y'") } else { print -- cgit v1.2.1