From 1a96af1f442ef1c1393fa1ce3a759dc16ce75f23 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Sat, 19 Dec 2020 02:19:37 -0300 Subject: Add Podcast structure, with public entrypoint commented out --- _config.yml | 45 +++++++++ _includes/feed.atom | 104 ++++++++++++++++----- _layouts/default.html | 10 +- _layouts/podcast.html | 10 ++ episodes-de-podcast-par-categorie.md | 13 +++ episodios-do-podcast-por-categoria.md | 13 +++ .../eo/LC_MESSAGES/podcast-episodes-by-category.po | 31 ++++++ locale/eo/LC_MESSAGES/podcast.en.po | 29 ++++++ .../fr/LC_MESSAGES/podcast-episodes-by-category.po | 31 ++++++ locale/fr/LC_MESSAGES/podcast.en.po | 29 ++++++ .../pt/LC_MESSAGES/podcast-episodes-by-category.po | 31 ++++++ locale/pt/LC_MESSAGES/podcast.en.po | 29 ++++++ podcast-episodes-by-category.md | 13 +++ podcast.en.md | 13 +++ podcast.fr.md | 13 +++ podcast.pt.md | 13 +++ podkastajoj-lau-kategorio.md | 13 +++ podkasto.md | 13 +++ scripts/assert-content.sh | 40 +++++--- scripts/spelling/eo.txt | 1 + scripts/spelling/pt.txt | 2 + site.json | 21 +++++ 22 files changed, 474 insertions(+), 43 deletions(-) create mode 100644 _layouts/podcast.html create mode 100644 episodes-de-podcast-par-categorie.md create mode 100644 episodios-do-podcast-por-categoria.md create mode 100644 locale/eo/LC_MESSAGES/podcast-episodes-by-category.po create mode 100644 locale/eo/LC_MESSAGES/podcast.en.po create mode 100644 locale/fr/LC_MESSAGES/podcast-episodes-by-category.po create mode 100644 locale/fr/LC_MESSAGES/podcast.en.po create mode 100644 locale/pt/LC_MESSAGES/podcast-episodes-by-category.po create mode 100644 locale/pt/LC_MESSAGES/podcast.en.po create mode 100644 podcast-episodes-by-category.md create mode 100644 podcast.en.md create mode 100644 podcast.fr.md create mode 100644 podcast.pt.md create mode 100644 podkastajoj-lau-kategorio.md create mode 100644 podkasto.md diff --git a/_config.yml b/_config.yml index d21259d..5b252da 100644 --- a/_config.yml +++ b/_config.yml @@ -18,6 +18,10 @@ kramdown: block: line_numbers: true +atom: + podcasts: + audio: true + exclude: - Gemfile - Gemfile.lock @@ -47,6 +51,9 @@ collections: slides: output: true permalink: /slides/:year/:month/:day/:title:output_ext + podcasts: + output: true + permalink: /podcast/:year/:month/:day/:title:output_ext t: description: @@ -212,6 +219,44 @@ t: pt: "eslaides-por-categoria.md" fr: "diapositives-par-categorie.md" eo: "lumbildoj-lau-kategorio.md" + podcasts: + name: + en: "Podcast" + pt: "Podcast" + fr: "Podcast" + eo: "Podkasto" + url: + en: "podcast.en.md" + pt: "podcast.pt.md" + fr: "podcast.fr.md" + eo: "podkasto.md" + listing: + en: "Podcast episodes" + pt: "Episódios do podcast" + fr: "Épisodes de podcast" + eo: "Podkastaĵoj" + feed: + title: + en: "EuAndreh's Podcast" + pt: "Podcast do EuAndreh" + fr: "Podcast d'EuAndreh" + eo: "Podkasto de EuAndreh" + url: + en: "/feed.podcasts.en.atom" + pt: "/feed.podcasts.pt.atom" + fr: "/feed.podcasts.fr.atom" + eo: "/feed.podcasts.eo.atom" + category: + name: + en: "Podcast episodes by category" + pt: "Episódios do podcast por categoria" + fr: "Épisodes de podcast par catégorie" + eo: "Podkastaĵoj laŭ kategoria" + url: + en: "podcast-episodes-by-category.md" + pt: "episodios-do-podcast-por-categoria.md" + fr: "episodes-de-podcast-par-categorie.md" + eo: "podkastajoj-lau-kategorio.md" posted_on: en: "Posted on" pt: "Postado em" diff --git a/_includes/feed.atom b/_includes/feed.atom index e627f9c..9facc5a 100644 --- a/_includes/feed.atom +++ b/_includes/feed.atom @@ -1,34 +1,88 @@ - - - - {{ site.time | date_to_xmlschema }} - {{ page.url | absolute_url | xml_escape }} +{% assign is_audio=site.atom[include.kind].audio %} + {% if is_audio %} + + + {{ site.t.podcasts.feed.title }} + {{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }} + {{ page.url | absolute_url | xml_escape }} + + {{ include.lang }} + CC BY-SA 4.0 - {{ site.title | xml_escape }} - {{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }} + + + + Sat, 25 Mar 2006 11:30:00 -0500 + Sat, 25 Mar 2006 11:30:00 -0500 + http://blogs.law.harvard.edu/tech/rss - - {{ site.author.name | xml_escape }} - {{ site.author.email | xml_escape }} - - - {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %} - {% for entry in entries %} - - {{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }} - - {{ entry.date | date_to_xmlschema }} - {{ entry.updated_at | default: entry.date | date_to_xmlschema }} - {{ entry.url | absolute_url | xml_escape }} - - {{ entry.content | strip | xml_escape }} + {{ site.author.email | xml_escape }} ({{ site.author.name | xml_escape }}) + + https://hipsters.tech/wp-content/uploads/2016/07/hipsters-logo.png + {{ page.url | absolute_url | xml_escape }} + {{ site.t.podcasts.feed.title }} + + {% else %} + + + + {{ site.title | xml_escape }} + {{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }} + {{ page.url | absolute_url | xml_escape }} + {{ site.time | date_to_xmlschema }} {{ site.author.name | xml_escape }} {{ site.author.email | xml_escape }} + {% endif %} + + {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %} + {% for entry in entries %} + {% if is_audio %} + + {{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }} + {{ entry.url | absolute_url | xml_escape }} + {{ entry.url | absolute_url | xml_escape }} + + {{ entry.content | strip | xml_escape }} + + + EuAndreh + Sat, 25 Mar 2006 11:30:00 -0500 + + + + + {% else %} + + {{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }} + + {{ entry.date | date_to_xmlschema }} + {{ entry.updated_at | default: entry.date | date_to_xmlschema }} + {{ entry.url | absolute_url | xml_escape }} + + + {{ entry.content | strip | xml_escape }} + - {{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }} - + + {{ site.author.name | xml_escape }} + {{ site.author.email | xml_escape }} + + + {{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }} + + {% endif %} {% endfor %} - + +{% if is_audio %} + + +{% else %} + +{% endif %} diff --git a/_layouts/default.html b/_layouts/default.html index 8458cbe..05ee5d1 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -4,10 +4,11 @@ - - - - + + + + + {{ page.title }} - EuAndreh @@ -41,6 +42,7 @@ {{ site.t.tils.name[page.lang] }} {{ site.t.slides.name[page.lang] }} {{ site.t.pastebins.name[page.lang] }} + {{ site.t.about.name[page.lang] }} {% if page.ref != nil %} diff --git a/_layouts/podcast.html b/_layouts/podcast.html new file mode 100644 index 0000000..e75ca7d --- /dev/null +++ b/_layouts/podcast.html @@ -0,0 +1,10 @@ +--- +layout: post +--- + + + +{{ content }} diff --git a/episodes-de-podcast-par-categorie.md b/episodes-de-podcast-par-categorie.md new file mode 100644 index 0000000..ce6f66e --- /dev/null +++ b/episodes-de-podcast-par-categorie.md @@ -0,0 +1,13 @@ +--- + +title: Épisodes de podcast par catégorie + +layout: page + +lang: fr + +ref: podcast-episodes-by-category + +--- + +{% include categories.html kind="podcasts" %} diff --git a/episodios-do-podcast-por-categoria.md b/episodios-do-podcast-por-categoria.md new file mode 100644 index 0000000..42eceaa --- /dev/null +++ b/episodios-do-podcast-por-categoria.md @@ -0,0 +1,13 @@ +--- + +title: Episódios do podcast por categoria + +layout: page + +lang: pt + +ref: podcast-episodes-by-category + +--- + +{% include categories.html kind="podcasts" %} diff --git a/locale/eo/LC_MESSAGES/podcast-episodes-by-category.po b/locale/eo/LC_MESSAGES/podcast-episodes-by-category.po new file mode 100644 index 0000000..856b970 --- /dev/null +++ b/locale/eo/LC_MESSAGES/podcast-episodes-by-category.po @@ -0,0 +1,31 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast episodes by category" +msgstr "title: Podkastaĵoj laŭ kategorio" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: eo" + +msgid "ref: podcast-episodes-by-category" +msgstr "ref: podcast-episodes-by-category" + +msgid "{% include categories.html kind=\"podcasts\" %}" +msgstr "{% include categories.html kind=\"podcasts\" %}" + +#~ msgid "{% include categories.html kind=\"pastebins\" %}" +#~ msgstr "{% include categories.html kind=\"pastebins\" %}" diff --git a/locale/eo/LC_MESSAGES/podcast.en.po b/locale/eo/LC_MESSAGES/podcast.en.po new file mode 100644 index 0000000..924cf34 --- /dev/null +++ b/locale/eo/LC_MESSAGES/podcast.en.po @@ -0,0 +1,29 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: eo\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast" +msgstr "title: Podkasto" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: eo" + +msgid "ref: podcast" +msgstr "ref: podcast" + +msgid "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" +msgstr "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" diff --git a/locale/fr/LC_MESSAGES/podcast-episodes-by-category.po b/locale/fr/LC_MESSAGES/podcast-episodes-by-category.po new file mode 100644 index 0000000..3bd3a23 --- /dev/null +++ b/locale/fr/LC_MESSAGES/podcast-episodes-by-category.po @@ -0,0 +1,31 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast episodes by category" +msgstr "title: Épisodes de podcast par catégorie" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: fr" + +msgid "ref: podcast-episodes-by-category" +msgstr "ref: podcast-episodes-by-category" + +msgid "{% include categories.html kind=\"podcasts\" %}" +msgstr "{% include categories.html kind=\"podcasts\" %}" + +#~ msgid "{% include categories.html kind=\"pastebins\" %}" +#~ msgstr "{% include categories.html kind=\"pastebins\" %}" diff --git a/locale/fr/LC_MESSAGES/podcast.en.po b/locale/fr/LC_MESSAGES/podcast.en.po new file mode 100644 index 0000000..cf2e4bb --- /dev/null +++ b/locale/fr/LC_MESSAGES/podcast.en.po @@ -0,0 +1,29 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: fr\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast" +msgstr "title: Podcast" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: fr" + +msgid "ref: podcast" +msgstr "ref: podcast" + +msgid "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" +msgstr "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" diff --git a/locale/pt/LC_MESSAGES/podcast-episodes-by-category.po b/locale/pt/LC_MESSAGES/podcast-episodes-by-category.po new file mode 100644 index 0000000..235d098 --- /dev/null +++ b/locale/pt/LC_MESSAGES/podcast-episodes-by-category.po @@ -0,0 +1,31 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast episodes by category" +msgstr "title: Episódios do podcast por categoria" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: pt" + +msgid "ref: podcast-episodes-by-category" +msgstr "ref: podcast-episodes-by-category" + +msgid "{% include categories.html kind=\"podcasts\" %}" +msgstr "{% include categories.html kind=\"podcasts\" %}" + +#~ msgid "{% include categories.html kind=\"pastebins\" %}" +#~ msgstr "{% include categories.html kind=\"pastebins\" %}" diff --git a/locale/pt/LC_MESSAGES/podcast.en.po b/locale/pt/LC_MESSAGES/podcast.en.po new file mode 100644 index 0000000..e6a2dcb --- /dev/null +++ b/locale/pt/LC_MESSAGES/podcast.en.po @@ -0,0 +1,29 @@ +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"POT-Creation-Date: \n" +"PO-Revision-Date: \n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: pt\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n > 1);\n" +"X-Generator: Poedit 2.4.2\n" + +msgid "title: Podcast" +msgstr "title: Podcast" + +msgid "layout: page" +msgstr "layout: page" + +msgid "lang: en" +msgstr "lang: pt" + +msgid "ref: podcast" +msgstr "ref: podcast" + +msgid "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" +msgstr "{% include link-listing.html entries=site.podcasts kind=\"podcasts\" %}" diff --git a/podcast-episodes-by-category.md b/podcast-episodes-by-category.md new file mode 100644 index 0000000..4a4931d --- /dev/null +++ b/podcast-episodes-by-category.md @@ -0,0 +1,13 @@ +--- + +title: Podcast episodes by category + +layout: page + +lang: en + +ref: podcast-episodes-by-category + +--- + +{% include categories.html kind="podcasts" %} diff --git a/podcast.en.md b/podcast.en.md new file mode 100644 index 0000000..5d343c8 --- /dev/null +++ b/podcast.en.md @@ -0,0 +1,13 @@ +--- + +title: Podcast + +layout: page + +lang: en + +ref: podcast + +--- + +{% include link-listing.html entries=site.podcasts kind="podcasts" %} diff --git a/podcast.fr.md b/podcast.fr.md new file mode 100644 index 0000000..bd3b9a5 --- /dev/null +++ b/podcast.fr.md @@ -0,0 +1,13 @@ +--- + +title: Podcast + +layout: page + +lang: fr + +ref: podcast + +--- + +{% include link-listing.html entries=site.podcasts kind="podcasts" %} diff --git a/podcast.pt.md b/podcast.pt.md new file mode 100644 index 0000000..95441f2 --- /dev/null +++ b/podcast.pt.md @@ -0,0 +1,13 @@ +--- + +title: Podcast + +layout: page + +lang: pt + +ref: podcast + +--- + +{% include link-listing.html entries=site.podcasts kind="podcasts" %} diff --git a/podkastajoj-lau-kategorio.md b/podkastajoj-lau-kategorio.md new file mode 100644 index 0000000..cbc9b6e --- /dev/null +++ b/podkastajoj-lau-kategorio.md @@ -0,0 +1,13 @@ +--- + +title: Podkastaĵoj laŭ kategorio + +layout: page + +lang: eo + +ref: podcast-episodes-by-category + +--- + +{% include categories.html kind="podcasts" %} diff --git a/podkasto.md b/podkasto.md new file mode 100644 index 0000000..a4d0a8c --- /dev/null +++ b/podkasto.md @@ -0,0 +1,13 @@ +--- + +title: Podkasto + +layout: page + +lang: eo + +ref: podcast + +--- + +{% include link-listing.html entries=site.podcasts kind="podcasts" %} diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index fd017b0..e8d0382 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -45,10 +45,6 @@ get-lang() { echo "${1}" | base64 --decode | jq -r .lang } -get-ref() { - echo "${1}" | base64 --decode | jq -r .ref -} - get-url() { # Remove leading / to match more closely the filesystem hierarchy echo "${1}" | base64 --decode | jq -r .url | sed 's_^/__' @@ -58,12 +54,8 @@ get-date() { echo "${1}" | base64 --decode | jq -r .date | awk '{print $1}' } -get-title() { - echo "${1}" | base64 --decode | jq -r .title -} - -get-layout() { - echo "${1}" | base64 --decode | jq -r .layout +get-x() { + echo "${2}" | base64 --decode | jq -r ".$1" } is-ignored() { @@ -84,10 +76,10 @@ assert-frontmatter() { PREFIX="${3:-}" EXTENSION="${4:-md}" LLANG="$(get-lang "$F")" - REF="$(get-ref "$F")" + REF="$(get-x ref "$F")" URL="$(get-url "$F")" - LAYOUT="$(get-layout "$F")" - TITLE="$(get-title "$F")" + LAYOUT="$(get-x layout "$F")" + TITLE="$(get-x title "$F")" [[ -z "${LLANG}" ]] && fail-attr 'lang' "${URL}" [[ -z "${REF}" ]] && fail-attr 'ref' "${URL}" @@ -104,6 +96,20 @@ assert-frontmatter() { exit 1 fi + if [[ "$PREFIX" = '_podcasts/' ]]; then + AUDIO="$(get-x audio "$F")" + [[ -z "$AUDIO" ]] && fail-attr 'audio' "${URL}" + for audiofmt in flac ogg; do + DATE="$(get-date "$F")" + URL_BASENAME="$(basename "$(get-url "$F")")" + AUDIO="resources/podcasts/$LLANG/${DATE}-${REF}.$audiofmt" + if [[ ! -f "$AUDIO" ]]; then + red "Missing audio file '$AUDIO'." + exit 1 + fi + done + fi + if [[ "$DESIRED_LAYOUT" != 'page' ]]; then DATE="$(get-date "$F")" URL_BASENAME="$(basename "$(get-url "$F")")" @@ -159,6 +165,11 @@ for slide in $(jq -r '.slides[] | @base64' "${JSON}"); do assert-frontmatter "$slide" 'slides' '_slides/' 'slides' done +echo Linting podcasts... >&2 +for podcast in $(jq -r '.podcasts[] | @base64' "${JSON}"); do + assert-frontmatter "$podcast" 'podcast' '_podcasts/' +done + echo Asserting unique refs... >&2 KNOWN_IDS=() assert-unique-ref() { @@ -167,7 +178,7 @@ assert-unique-ref() { URL="$(get-url "$page")" if ! is-ignored "${URL}"; then LLANG="$(get-lang "$page")" - REF="$(get-ref "$page")" + REF="$(get-x ref "$page")" ID="${TYPE}:${LLANG}:${REF}" if contains-element "${ID}" "${KNOWN_IDS[@]}"; then @@ -186,5 +197,6 @@ 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' +assert-unique-ref "$(jq -r '.podcasts[] | @base64' "${JSON}")" 'podcasts' echo Done. >&2 diff --git a/scripts/spelling/eo.txt b/scripts/spelling/eo.txt index aa19e9f..8629511 100644 --- a/scripts/spelling/eo.txt +++ b/scripts/spelling/eo.txt @@ -6,5 +6,6 @@ H HML L M +Podkastaĵoj ernis odiaŭ diff --git a/scripts/spelling/pt.txt b/scripts/spelling/pt.txt index 59e4113..9a0bfa5 100644 --- a/scripts/spelling/pt.txt +++ b/scripts/spelling/pt.txt @@ -12,6 +12,7 @@ L Lista Me Patches +Podcast Postado Postagens Quando @@ -96,6 +97,7 @@ padrão para parar pessoal +podcast por post postagens diff --git a/site.json b/site.json index 0fa59ac..425ebfe 100644 --- a/site.json +++ b/site.json @@ -95,5 +95,26 @@ "content": {{ slide.content | strip_html | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} + ], + "podcasts": [ + {% assign filtered_podcasts = "" | split:"" %} + {% for podcast in site.podcasts %} + {% unless podcast.plaintext %} + {% assign filtered_podcasts = filtered_podcasts | push:podcast %} + {% endunless %} + {% endfor %} + {% for podcast in filtered_podcasts %} + { + "title": "{{ podcast.title | smartify }}", + "date": "{{ podcast.date }}", + "url": "{{ podcast.url }}", + "lang": "{{ podcast.lang }}", + "ref": "{{ podcast.ref }}", + "layout": "{{ podcast.layout }}", + "content": {{ podcast.content | strip_html | jsonify }}, + "audio": "{{ podcast.audio }}" + }{% unless forloop.last %},{% endunless %} + {% endfor %} + ] } -- cgit v1.2.3