change to written_at
This commit is contained in:
parent
b37fdc634c
commit
c00aba77eb
1 changed files with 4 additions and 4 deletions
8
blag
8
blag
|
@ -29,17 +29,17 @@ metadata() {
|
||||||
local icon=$(_json_str_opt "$ICON")
|
local icon=$(_json_str_opt "$ICON")
|
||||||
local icon_alt=$(_json_str_opt "$ICON_ALT")
|
local icon_alt=$(_json_str_opt "$ICON_ALT")
|
||||||
local color=$(_json_str_opt "$COLOR")
|
local color=$(_json_str_opt "$COLOR")
|
||||||
local created_at=$(_json_str_opt "$CREATED_AT")
|
local written_at=$(_json_str_opt "$WRITTEN_AT")
|
||||||
local modified_at=$(_json_str_opt "$MODIFIED_AT")
|
local modified_at=$(_json_str_opt "$MODIFIED_AT")
|
||||||
local tags=$(for tag in "${TAGS[@]}"; do printf '%s' "$tag" | jq -Rs .; done | jq -sr @json)
|
local tags=$(for tag in "${TAGS[@]}"; do printf '%s' "$tag" | jq -Rs .; done | jq -sr @json)
|
||||||
local dont_cache=false
|
local dont_cache=false
|
||||||
[[ "${DONT_CACHE:+x}" == 'x' ]] && dont_cache=true
|
[[ "${DONT_CACHE:+x}" == 'x' ]] && dont_cache=true
|
||||||
local raw=$(_json_str_opt "$RAW")
|
local raw=$(_json_str_opt "$RAW")
|
||||||
|
|
||||||
printf '{"title":%s,"description":%s,"author":%s,"icon":%s,"icon_alt":%s,"color":%s,"created_at":%s,"modified_at":%s,"tags":%s,"dont_cache":%s,"raw":%s}\n' \
|
printf '{"title":%s,"description":%s,"author":%s,"icon":%s,"icon_alt":%s,"color":%s,"written_at":%s,"modified_at":%s,"tags":%s,"dont_cache":%s,"raw":%s}\n' \
|
||||||
"$title" "$description" "$author" \
|
"$title" "$description" "$author" \
|
||||||
"$icon" "$icon_alt" "$color" \
|
"$icon" "$icon_alt" "$color" \
|
||||||
"$created_at" "$modified_at" \
|
"$written_at" "$modified_at" \
|
||||||
"$tags" "$dont_cache" "$raw"
|
"$tags" "$dont_cache" "$raw"
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -93,7 +93,7 @@ render() {(
|
||||||
if (( ! DATES_CALCULATED )); then
|
if (( ! DATES_CALCULATED )); then
|
||||||
birth=$(stat -c'%W' "$path")
|
birth=$(stat -c'%W' "$path")
|
||||||
if (( birth > 0 )); then
|
if (( birth > 0 )); then
|
||||||
CREATED_AT=$(date --rfc-3339=seconds -d "@$birth")
|
WRITTEN_AT=$(date --rfc-3339=seconds -d "@$birth")
|
||||||
fi
|
fi
|
||||||
MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$path")")
|
MODIFIED_AT=$(date --rfc-3339=seconds -d "@$(stat -c '%Y' "$path")")
|
||||||
DATES_CALCULATED=1
|
DATES_CALCULATED=1
|
||||||
|
|
Loading…
Reference in a new issue