diff options
Diffstat (limited to 'scripts')
-rwxr-xr-x | scripts/assert-content.sh | 67 | ||||
-rw-r--r-- | scripts/spelling/international.txt | 7 | ||||
-rw-r--r-- | scripts/spelling/pt.txt | 2 |
3 files changed, 67 insertions, 9 deletions
diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index 558e424..ff571c3 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -7,6 +7,7 @@ yellow="\033[0;33m" red() { echo -e "${red}${1}${end}"; } yellow() { echo -e "${yellow}${1}${end}"; } +TRACKERS='-a udp://tracker.coppersurfer.tk:6969/announce -a udp://tracker.ccc.de:80/announce -a udp://tracker.publicbt.com:80 -a udp://tracker.istole.it:80 -a http://tracker.openbittorrent.com:80/announce -a http://tracker.ipv6tracker.org:80/announce' ## Constant definitions @@ -124,8 +125,6 @@ assert-frontmatter() { fi done - TRACKERS='-a udp://tracker.coppersurfer.tk:6969/announce -a udp://tracker.ccc.de:80/announce -a udp://tracker.publicbt.com:80 -a udp://tracker.istole.it:80 -a http://tracker.openbittorrent.com:80/announce -a http://tracker.ipv6tracker.org:80/announce' - for audiofmt in ogg; do OGG="resources/podcasts/$DATE-$SLUG.ogg" TORRENT="$OGG.torrent" @@ -145,6 +144,50 @@ assert-frontmatter() { done fi + if [[ "$PREFIX" = '_screencasts/' ]]; then + VIDEO="$(get-x video "$F")" + SLUG="$(get-x slug "$F")" + + [[ -z "$VIDEO" ]] && fail-attr 'video' "${URL}" + [[ -z "$SLUG" ]] && fail-attr 'slug' "${URL}" + + TITLE_SLUG="$(slugify "$TITLE")" + if [[ "$SLUG" != "$TITLE_SLUG" ]]; then + red "slug and title don't match." + red "slug: '$SLUG'" + red "title slug: '$TITLE_SLUG'" + exit 1 + fi + + for videofmt in webm; do + DATE="$(get-date "$F")" + URL_BASENAME="$(basename "$(get-url "$F")")" + VIDEO="resources/screencasts/${DATE}-${SLUG}.$videofmt" + if [[ ! -f "$VIDEO" ]]; then + red "Missing video file '$VIDEO'." + exit 1 + fi + done + + for videofmt in webm; do + WEBM="resources/screencasts/$DATE-$SLUG.webm" + TORRENT="$WEBM.torrent" + WEBSEED="https://euandre.org/$WEBM" + if [ ! -f "$TORRENT" ]; then + yellow "Missing torrent $TORRENT, generating..." + mktorrent $TRACKERS \ + -f \ + -v \ + -d \ + -c "$(cat _screencasts/$DATE-$SLUG.md)" \ + -n "$TITLE.webm" \ + -w "$WEBSEED" \ + -o "$TORRENT" \ + "$WEBM" + fi + done + fi + if [[ "$DESIRED_LAYOUT" != 'page' ]]; then DATE="$(get-date "$F")" URL_BASENAME="$(basename "$(get-url "$F")")" @@ -202,7 +245,12 @@ done echo Linting podcasts... >&2 for podcast in $(jq -r '.podcasts[] | @base64' "${JSON}"); do - assert-frontmatter "$podcast" 'podcast' '_podcasts/' + assert-frontmatter "$podcast" 'cast' '_podcasts/' +done + +echo Linting screencasts... >&2 +for screencast in $(jq -r '.screencasts[] | @base64' "${JSON}"); do + assert-frontmatter "$screencast" 'cast' '_screencasts/' done echo Asserting unique refs... >&2 @@ -228,11 +276,12 @@ assert-unique-ref() { done } -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 '.pastebins[] | @base64' "${JSON}")" 'pastebin' -assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")" 'slides' -assert-unique-ref "$(jq -r '.podcasts[] | @base64' "${JSON}")" 'podcasts' +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 '.pastebins[] | @base64' "${JSON}")" 'pastebin' +assert-unique-ref "$(jq -r '.slides[] | @base64' "${JSON}")" 'slides' +assert-unique-ref "$(jq -r '.podcasts[] | @base64' "${JSON}")" 'podcasts' +assert-unique-ref "$(jq -r '.screencasts[] | @base64' "${JSON}")" 'screencasts' echo Done. >&2 diff --git a/scripts/spelling/international.txt b/scripts/spelling/international.txt index 4fce56c..562c9b7 100644 --- a/scripts/spelling/international.txt +++ b/scripts/spelling/international.txt @@ -104,6 +104,8 @@ Reddit Redux SA SSD +Screencast +Screencasts ShellCheck Slava Sourcehut @@ -122,6 +124,7 @@ UI URL VPN WebAssembly +WebTorrent Wollrath Wyant Yandex @@ -206,16 +209,20 @@ pt rollout rollouts sbcl +screencast +screencasts songbooks sourcehut sr swift2nix systemd só +torrent touchpad txt v8 vlog +webtorrent www xp xyz diff --git a/scripts/spelling/pt.txt b/scripts/spelling/pt.txt index 9a0bfa5..c7da56d 100644 --- a/scripts/spelling/pt.txt +++ b/scripts/spelling/pt.txt @@ -60,6 +60,7 @@ escrevo esforço estou eu +exemplo existentes extra fazer @@ -117,6 +118,7 @@ significa simples sobre tempo +teste texto timestamp transpor |