diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/assert-content.sh | 21 |
1 files changed, 18 insertions, 3 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index ab11183..8e30aca 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -131,6 +131,19 @@ for til in $(jq -r '.tils[] | @base64' "${JSON}"); do } done +echo Lintins slides... >&2 +for slide in $(jq -r '.slides[] | @base64' "${JSON}"); do + assert-frontmatter "$slide" + DATE="$(get-date "$slide" | awk '{print $1}')" + URL="$(basename "$(get-url "$slide")")" + FILE="_slides/${DATE}-${URL%.html}.html" + + [[ -f "${FILE}" ]] || { + red "date/filename mismatch: '${FILE}' does not exist." + exit 1 + } +done + echo Asserting unique refs... >&2 KNOWN_IDS=() assert-unique-ref() { @@ -153,9 +166,10 @@ assert-unique-ref() { done } -assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")" -assert-unique-ref "$(jq -r '.posts[] | @base64' "${JSON}")" -assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")" +assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")" +assert-unique-ref "$(jq -r '.pastebins[] | @base64' "${JSON}")" +assert-unique-ref "$(jq -r '.posts[] | @base64' "${JSON}")" +assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")" echo Asserting layouts... >&2 assert-layout() { @@ -174,5 +188,6 @@ assert-layout() { assert-layout "$(jq -r '.posts[] | @base64' "${JSON}")" "post" assert-layout "$(jq -r '.pastebins[] | @base64' "${JSON}")" "pastebin" assert-layout "$(jq -r '.tils[] | @base64' "${JSON}")" "til" +assert-layout "$(jq -r '.slides[] | @base64' "${JSON}")" "slide" echo Done. >&2 |