aboutsummaryrefslogtreecommitdiff
path: root/scripts/assert-content.sh
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/assert-content.sh')
-rwxr-xr-xscripts/assert-content.sh16
1 files changed, 7 insertions, 9 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh
index a86733d..44aed92 100755
--- a/scripts/assert-content.sh
+++ b/scripts/assert-content.sh
@@ -14,8 +14,6 @@ JSON='_site/site.json'
LANGS=(en pt fr)
IGNORED_PAGES=(site.json sitemap.xml *.atom)
-export LC_ALL=en_US.UTF-8
-
## Helper function definitions
slugify() {
@@ -75,12 +73,12 @@ assert-frontmatter() {
DESIRED_LAYOUT="$2"
PREFIX="${3:-}"
EXTENSION="${4:-md}"
- LANG="$(get-lang "$F")"
+ LLANG="$(get-lang "$F")"
REF="$(get-ref "$F")"
URL="$(get-url "$F")"
LAYOUT="$(get-layout "$F")"
- [[ -z "${LANG}" ]] && fail-attr 'lang' "${URL}"
+ [[ -z "${LLANG}" ]] && fail-attr 'lang' "${URL}"
[[ -z "${REF}" ]] && fail-attr 'ref' "${URL}"
if ! contains-element "${URL}" "${IGNORED_PAGES[@]}"; then
@@ -88,8 +86,8 @@ assert-frontmatter() {
[[ -z "${TITLE}" ]] && fail-attr 'title' "${URL}"
fi
- if ! contains-element "${LANG}" "${LANGS[@]}"; then
- red "Invalid lang '${LANG}' in ${URL}." >&2
+ if ! contains-element "${LLANG}" "${LANGS[@]}"; then
+ red "Invalid lang '${LLANG}' in ${URL}." >&2
exit 1
fi
@@ -109,7 +107,7 @@ assert-frontmatter() {
exit 1
}
- if [[ "$DESIRED_LAYOUT" != 'pastebin' ]] && [[ "$LANG" = 'en' ]]; then
+ if [[ "$DESIRED_LAYOUT" != 'pastebin' ]] && [[ "$LLANG" = 'en' ]]; then
TITLE_SLUG="$(slugify "$TITLE")"
if [[ "$TITLE_SLUG" != "$REF" ]]; then
red "ref isn't the slug of the title."
@@ -161,9 +159,9 @@ assert-unique-ref() {
for page in $1; do
URL="$(get-url "$page")"
if ! contains-element "${URL}" "${IGNORED_PAGES[@]}"; then
- LANG="$(get-lang "$page")"
+ LLANG="$(get-lang "$page")"
REF="$(get-ref "$page")"
- ID="${TYPE}:${LANG}:${REF}"
+ ID="${TYPE}:${LLANG}:${REF}"
if contains-element "${ID}" "${KNOWN_IDS[@]}"; then
printf '%s\n' "${KNOWN_IDS[@]}"