update lastmod git-hook

main
Dominic Reich 2 years ago
parent 84b05ec230
commit fb6d0d41a5
Signed by: dominic
GPG Key ID: BC9D6AE1A3BE169A

@ -3,8 +3,8 @@
# Replace `last_modified_at` timestamp with current time # Replace `last_modified_at` timestamp with current time
# https://mademistakes.com/notes/adding-last-modified-timestamps-with-git/ # https://mademistakes.com/notes/adding-last-modified-timestamps-with-git/
git diff --cached --name-status | egrep -i "^(A|M).*\.(md)$" | while read a b; do git diff --cached --name-status | grep -E -i "^(A|M).*\.(md)$" | while read a b; do
cat $b | sed "/---.*/,/---.*/s/^lastmod =.*$/lastmod = \'$(date -u "+%Y-%m-%dT%H:%M:%S%z")\'/" > tmp cat $b | sed "/+++.*/,/+++.*/s/^lastmod.*$/lastmod = '$(date -u "+%Y-%m-%dT%H:%M:%S%z")'/" > tmp
mv tmp $b mv tmp $b
git add $b git add $b
done done

@ -2,7 +2,7 @@
title = "Links" title = "Links"
summary = """Listing links of (hopefully) useful websites""" summary = """Listing links of (hopefully) useful websites"""
date = "2022-11-20T15:56:36+0100" date = "2022-11-20T15:56:36+0100"
lastmod = '2023-04-10T09:25:37+0200' lastmod = '2023-04-10T08:06:48+0000'
comment = false comment = false

Loading…
Cancel
Save