aboutsummaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorEuAndreh <eu@euandre.org>2020-08-14 13:17:03 -0300
committerEuAndreh <eu@euandre.org>2020-08-14 13:17:03 -0300
commit0443acebe06652ef8819c3d10eaf7faa14674118 (patch)
tree5c4d94c7f5ac38931126dbde5f0d2e12a54bce86 /scripts
parentAdd TIL on git checkout (diff)
downloadeuandre.org-0443acebe06652ef8819c3d10eaf7faa14674118.tar.gz
euandre.org-0443acebe06652ef8819c3d10eaf7faa14674118.tar.xz
Assert date matches TIL filename
Diffstat (limited to '')
-rwxr-xr-xscripts/assert-content.sh8
1 files changed, 8 insertions, 0 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh
index d8fe89f..87670ab 100755
--- a/scripts/assert-content.sh
+++ b/scripts/assert-content.sh
@@ -96,6 +96,14 @@ done
echo Linting tils... >&2
for til in $(jq -r '.tils[] | @base64' "${JSON}"); do
assert-frontmatter "$til"
+ DATE="$(get-date "$til" | awk '{print $1}')"
+ URL="$(basename "$(get-url "$til")")"
+ FILE="_tils/${DATE}-${URL%.html}.md"
+
+ [[ -f "${FILE}" ]] || {
+ red "date/filename mismatch: '${FILE}' does not exist."
+ exit 1
+ }
done
echo Asserting unique refs... >&2