diff options
author | EuAndreh <eu@euandre.org> | 2020-10-23 06:19:23 -0300 |
---|---|---|
committer | EuAndreh <eu@euandre.org> | 2020-10-23 06:19:23 -0300 |
commit | 1eb373f76a5226390501de413c3843b00e8abf7a (patch) | |
tree | 05b85a64e991f54b553b322ef8bfd356db1345fb /scripts | |
parent | assert-content.sh: Enforce "ref" is the slug of the "title" for pages in en (diff) | |
download | euandre.org-1eb373f76a5226390501de413c3843b00e8abf7a.tar.gz euandre.org-1eb373f76a5226390501de413c3843b00e8abf7a.tar.xz |
assert-content.sh: Include page title when checking for unique refs
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/assert-content.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index 2fcf1a9..b9d97b2 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -152,12 +152,13 @@ done echo Asserting unique refs... >&2 KNOWN_IDS=() assert-unique-ref() { + TYPE="$2" for page in $1; do URL="$(get-url "$page")" if ! contains-element "${URL}" "${IGNORED_PAGES[@]}"; then LANG="$(get-lang "$page")" REF="$(get-ref "$page")" - ID="${LANG}:${REF}" + ID="${TYPE}:${LANG}:${REF}" if contains-element "${ID}" "${KNOWN_IDS[@]}"; then printf '%s\n' "${KNOWN_IDS[@]}" @@ -171,9 +172,9 @@ assert-unique-ref() { done } -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}")" +assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")" 'page' +assert-unique-ref "$(jq -r '.articles[] | @base64' "${JSON}")" 'article' +assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")" 'til' +assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")" 'slides' echo Done. >&2 |