diff options
-rwxr-xr-x | src/conf | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -46,6 +46,10 @@ dateiso() { datex "$1" -u "$DATE_Is" } +dateepoch() { + datex "$1" '+%s' +} + CONF="${1:-}" FILENAME="${2:-}" eval "$(assert-arg -- "$CONF" 'CONF')" @@ -69,6 +73,7 @@ needs "${sourcecode_url_prefix:-}" 'Missing required $sourcecode_url_prefix' if [ "$GENERATE" = true ]; then now_iso="$(dateiso "@${SOURCE_DATE_EPOCH:-$(date '+%s')}" | shesc)" + now_epoch="$(dateepoch "$now_iso" | shesc)" feed_title_html="$(printf '%s\n' "$feed_title" | htmlesc | shesc)" site_name_html="$( printf '%s\n' "$site_name" | htmlesc | shesc)" if [ -z "${logo_alt:-}" ]; then @@ -79,6 +84,7 @@ if [ "$GENERATE" = true ]; then cat -- "$CONF" cat <<-EOF export now_iso="$now_iso" + export now_epoch="$now_epoch" export feed_title_html="$feed_title_html" export site_name_html="$site_name_html" export feed_url_absolute="$url_pre/$feed_url" @@ -144,15 +150,19 @@ url="$(printf '%s\n' "${UNPREFIXED%.adoc}.html" | shesc)" collurl= date_iso= +date_epoch= date_formatted= updatedat_iso= +updatedat_epoch= updatedat_formatted= if is_article; then lastdirnames="$(last3dirnames)" date_iso="$(dateiso "$lastdirnames" | shesc)" + date_epoch="$(dateepoch "$date_iso" | shesc)" date_formatted="$(datefmt "$date_iso" | shesc)" if [ -n "${updatedat:-}" ]; then updatedat_iso="$(dateiso "$updatedat" | shesc)" + updatedat_epoch="$(dateepoch "$updatedat_iso" | shesc)" updatedat_formatted="$(datefmt "$updatedat_iso" | shesc)" fi file="$(basename "$url")" @@ -228,8 +238,10 @@ cat <<-EOF export titlefull="$titlefull" export titlefull_html="$titlefull_html" export date_iso="$date_iso" + export date_epoch="$date_epoch" export date_formatted="$date_formatted" export updatedat_iso="$updatedat_iso" + export updatedat_epoch="$updatedat_epoch" export updatedat_formatted="$updatedat_formatted" export comment_url="$comment_url" export discussions_url="$discussions_url" |