update lastmod git-hook
This commit is contained in:
parent
84b05ec230
commit
fb6d0d41a5
2 changed files with 3 additions and 3 deletions
|
@ -3,8 +3,8 @@
|
|||
# Replace `last_modified_at` timestamp with current time
|
||||
# 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
|
||||
cat $b | sed "/---.*/,/---.*/s/^lastmod =.*$/lastmod = \'$(date -u "+%Y-%m-%dT%H:%M:%S%z")\'/" > tmp
|
||||
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
|
||||
mv tmp $b
|
||||
git add $b
|
||||
done
|
||||
|
|
|
@ -2,7 +2,7 @@
|
|||
title = "Links"
|
||||
summary = """Listing links of (hopefully) useful websites"""
|
||||
date = "2022-11-20T15:56:36+0100"
|
||||
lastmod = '2023-04-10T09:25:37+0200'
|
||||
lastmod = '2023-04-10T08:06:48+0000'
|
||||
|
||||
comment = false
|
||||
|
||||
|
|
Loading…
Reference in a new issue