aboutsummaryrefslogtreecommitdiff
path: root/scripts/assert-content.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/assert-content.sh')
-rwxr-xr-xscripts/assert-content.sh25
1 files changed, 8 insertions, 17 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh
index a0d661f..e694580 100755
--- a/scripts/assert-content.sh
+++ b/scripts/assert-content.sh
@@ -8,23 +8,8 @@ red() { echo -e "${red}${1}${end}"; }
## Constant definitions
-JSON="${1:-}"
-[[ -z "${JSON}" ]] && {
- red 'Missing input JSON file.'
- cat <<EOF
-Usage:
- $0 <SITE_JSON_PATH>
-
- Arguments
- SITE_JSON_PATH Path to the site.json file which contains data and metadata about pages of the site.
-
-Examples:
- $0 _site/site.json
- $0 result/site.json
- $0 \$(nix-build -A subtasks.docs)/site.json
-EOF
- exit 2
-}
+jekyll build
+JSON='_site/site.json'
LANGS=(en pt fr)
IGNORED_PAGES=(site.json sitemap.xml *.atom)
@@ -138,6 +123,11 @@ for til in $(jq -r '.tils[] | @base64' "${JSON}"); do
assert-frontmatter "$til" 'post' '_tils'
done
+echo Linting slides... >&2
+for slide in $(jq -r '.slides[] | @base64' "${JSON}"); do
+ assert-frontmatter "$slide" 'post' '_slides'
+done
+
echo Asserting unique refs... >&2
KNOWN_IDS=()
assert-unique-ref() {
@@ -163,5 +153,6 @@ assert-unique-ref() {
assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")"
assert-unique-ref "$(jq -r '.articles[] | @base64' "${JSON}")"
assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")"
+assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")"
echo Done. >&2