build(justfile): commit new daily email post

This commit is contained in:
Oliver Davies 2023-04-19 22:14:10 +01:00
parent 168f51105d
commit 75f713e1c7

6
run
View file

@ -28,7 +28,7 @@ function task:daily {
slug=$(echo "${title}" | awk '{print tolower($0)}' | tr ' ' '-')
# Create the file.
cp -vf --no-clobber stub.md "${filepath}"
cp -f --no-clobber stub.md "${filepath}"
local day
local month
@ -43,6 +43,10 @@ function task:daily {
sed -i "s/{{ title }}/${title}/" "${filepath}"
sed -i "s#{{ permalink }}#archive/${year}/${month}/${day}/${slug}#" "${filepath}"
# Create a commit with the appropriate date in the message
git add "${filepath}"
git commit -m "daily-email: add ${date}"
echo "${filepath}"
}