From a7c4db7e9215694ef6c50debcc0b4e7402265687 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Mon, 5 Oct 2020 21:27:57 -0300 Subject: Refactor i18n structure, remove layouts, add slides Yep, this commit is too big big I didn't want to take the trouble of splitting it now. - _config.yml translation keys are now simetrical on the entitiy: articles, pastebins, tils, slides, etc.; - _posts were moved to _articles: the _posts collection had special treatment in Jekyll which I wanted to avoid; - the filtering of entries for the Atom feed is now done inside the _includes/feed.atom file instead of every feed file; - all entities are now dealt with using the pluralized name: articles, pastebins, tils, slides. No more inconsistencies on the key names, they now should only make sense as the translation value on the dictionary; - add base reveal.js infrastruture, with Jekyll generating the listing page and nothing else. --- scripts/assert-content.sh | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) (limited to 'scripts') 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 -- cgit v1.2.3