aboutsummaryrefslogtreecommitdiff
path: root/scripts/assert-content.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/assert-content.sh')
-rwxr-xr-xscripts/assert-content.sh10
1 files changed, 5 insertions, 5 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh
index e694580..626353c 100755
--- a/scripts/assert-content.sh
+++ b/scripts/assert-content.sh
@@ -8,7 +8,7 @@ red() { echo -e "${red}${1}${end}"; }
## Constant definitions
-jekyll build
+jekyll build --future
JSON='_site/site.json'
LANGS=(en pt fr)
@@ -63,6 +63,7 @@ assert-frontmatter() {
F="$1"
DESIRED_LAYOUT="$2"
PREFIX="${3:-}"
+ EXTENSION="${4:-md}"
LANG="$(get-lang "$F")"
REF="$(get-ref "$F")"
URL="$(get-url "$F")"
@@ -90,11 +91,10 @@ assert-frontmatter() {
if [[ -n "${PREFIX}" ]]; then
DATE="$(get-date "$F" | awk '{print $1}')"
URL_BASENAME="$(basename "$(get-url "$F")")"
- FILE="${PREFIX}/${DATE}-${URL_BASENAME%.html}.md"
+ FILE="${PREFIX}/${DATE}-${URL_BASENAME%.html}.${EXTENSION}"
[[ -f "${FILE}" ]] || {
- red "date/filename mismatch: '${FILE}' does not exist. To fix, run:"
- echo " mv '${PREFIX}/${URL_BASENAME%.html}.md' '${FILE}'"
+ red "date/filename mismatch: '${FILE}' does not exist."
exit 1
}
fi
@@ -125,7 +125,7 @@ done
echo Linting slides... >&2
for slide in $(jq -r '.slides[] | @base64' "${JSON}"); do
- assert-frontmatter "$slide" 'post' '_slides'
+ assert-frontmatter "$slide" 'slides' '_slides' 'slides'
done
echo Asserting unique refs... >&2