diff options
-rw-r--r-- | _config.yml | 45 | ||||
-rw-r--r-- | _includes/feed.atom | 104 | ||||
-rw-r--r-- | _layouts/default.html | 10 | ||||
-rw-r--r-- | _layouts/podcast.html | 10 | ||||
-rw-r--r-- | episodes-de-podcast-par-categorie.md | 13 | ||||
-rw-r--r-- | episodios-do-podcast-por-categoria.md | 13 | ||||
-rw-r--r-- | locale/eo/LC_MESSAGES/podcast-episodes-by-category.po | 31 | ||||
-rw-r--r-- | locale/eo/LC_MESSAGES/podcast.en.po | 29 | ||||
-rw-r--r-- | locale/fr/LC_MESSAGES/podcast-episodes-by-category.po | 31 | ||||
-rw-r--r-- | locale/fr/LC_MESSAGES/podcast.en.po | 29 | ||||
-rw-r--r-- | locale/pt/LC_MESSAGES/podcast-episodes-by-category.po | 31 | ||||
-rw-r--r-- | locale/pt/LC_MESSAGES/podcast.en.po | 29 | ||||
-rw-r--r-- | podcast-episodes-by-category.md | 13 | ||||
-rw-r--r-- | podcast.en.md | 13 | ||||
-rw-r--r-- | podcast.fr.md | 13 | ||||
-rw-r--r-- | podcast.pt.md | 13 | ||||
-rw-r--r-- | podkastajoj-lau-kategorio.md | 13 | ||||
-rw-r--r-- | podkasto.md | 13 | ||||
-rwxr-xr-x | scripts/assert-content.sh | 40 | ||||
-rw-r--r-- | scripts/spelling/eo.txt | 1 | ||||
-rw-r--r-- | scripts/spelling/pt.txt | 2 | ||||
-rw-r--r-- | site.json | 21 |
22 files changed, 474 insertions, 43 deletions
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 @@ -<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ include.lang }}"> - <link href="{{ page.url | absolute_url }}" rel="self" type="application/atom+xml" /> - <link href="{{ '/' | absolute_url }}" rel="alternate" type="text/html" hreflang="{{ include.lang }}" /> - <updated>{{ site.time | date_to_xmlschema }}</updated> - <id>{{ page.url | absolute_url | xml_escape }}</id> +{% assign is_audio=site.atom[include.kind].audio %}<?xml version="1.0" encoding="UTF-8"?> + {% if is_audio %} + <rss version="2.0" + xmlns:atom="http://www.w3.org/2005/Atom"> + <channel> + <title>{{ site.t.podcasts.feed.title }}</title> + <description>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</description> + <link>{{ page.url | absolute_url | xml_escape }}</link> + <atom:link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" /> + <language>{{ include.lang }}</language> + <copyright>CC BY-SA 4.0</copyright> - <title>{{ site.title | xml_escape }}</title> - <subtitle>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</subtitle> + <!-- <lastBuildDate>{{ site.time | date_to_xmlschema }}</lastBuildDate> --> + <!-- <pubDate>FIXME</pubDate> --> + <!-- <docs>http://blogs.law.harvard.edu/tech/rss</docs> --> + <lastBuildDate>Sat, 25 Mar 2006 11:30:00 -0500</lastBuildDate> + <pubDate>Sat, 25 Mar 2006 11:30:00 -0500</pubDate> + <docs>http://blogs.law.harvard.edu/tech/rss</docs> - <author> - <name>{{ site.author.name | xml_escape }}</name> - <email>{{ site.author.email | xml_escape }}</email> - </author> - - {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %} - {% for entry in entries %} - <entry xml:lang="{{ entry.lang }}"> - <title type="html">{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title> - <link href="{{ entry.url | absolute_url }}" rel="alternate" type="text/html" title="{{ entry.title | xml_escape }}" /> - <published>{{ entry.date | date_to_xmlschema }}</published> - <updated>{{ entry.updated_at | default: entry.date | date_to_xmlschema }}</updated> - <id>{{ entry.url | absolute_url | xml_escape }}</id> - - <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}">{{ entry.content | strip | xml_escape }}</content> + <webMaster>{{ site.author.email | xml_escape }} ({{ site.author.name | xml_escape }})</webMaster> + <image> + <url>https://hipsters.tech/wp-content/uploads/2016/07/hipsters-logo.png</url> + <link>{{ page.url | absolute_url | xml_escape }}</link> + <title>{{ site.t.podcasts.feed.title }}</title> + </image> + {% else %} + <feed + xmlns="http://www.w3.org/2005/Atom" + xmlns:content="http://purl.org/rss/1.0/modules/content/" + xml:lang="{{ include.lang }}"> + <link href="{{ page.url | absolute_url | xml_escape }}" rel="self" type="application/atom+xml" /> + <link href="{{ '/' | absolute_url | xml_escape }}" rel="alternate" type="text/html" hreflang="{{ include.lang }}" /> + <title>{{ site.title | xml_escape }}</title> + <subtitle>{{ site.t[include.kind].feed.title[include.lang] | smartify | xml_escape }}</subtitle> + <id>{{ page.url | absolute_url | xml_escape }}</id> + <updated>{{ site.time | date_to_xmlschema }}</updated> <author> <name>{{ site.author.name | xml_escape }}</name> <email>{{ site.author.email | xml_escape }}</email> </author> + {% endif %} + + {% assign entries = include.entries | where:"lang", include.lang | has_category:include.categories_filter | sort: "date" | reverse %} + {% for entry in entries %} + {% if is_audio %} + <item> + <title>{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title> + <link>{{ entry.url | absolute_url | xml_escape }}</link> + <guid>{{ entry.url | absolute_url | xml_escape }}</guid> + <description xml:base="{{ entry.url | absolute_url | xml_escape }}"> + {{ entry.content | strip | xml_escape }} + </description> + <enclosure url="{{ '/' | absolute_url | xml_escape }}resources/podcasts/{{ include.lang }}/{{ entry.date | date: "%Y-%m-%d" }}-{{ entry.ref }}.ogg" type="audio/ogg" length="11779397" /> + <category>EuAndreh</category> + <pubDate>Sat, 25 Mar 2006 11:30:00 -0500</pubDate> + <!-- <image> --> + <!-- <url>https://hipsters.tech/wp-content/uploads/2016/07/hipsters-logo.png</url> --> + <!-- </image> --> + </item> + {% else %} + <entry xml:lang="{{ entry.lang }}"> + <title type="html">{{ entry.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title> + <link href="{{ entry.url | absolute_url | xml_escape }}" rel="alternate" type="text/html" title="{{ entry.title | xml_escape }}" /> + <published>{{ entry.date | date_to_xmlschema }}</published> + <updated>{{ entry.updated_at | default: entry.date | date_to_xmlschema }}</updated> + <id>{{ entry.url | absolute_url | xml_escape }}</id> + + <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}"> + {{ entry.content | strip | xml_escape }} + </content> - <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary> - </entry> + <author> + <name>{{ site.author.name | xml_escape }}</name> + <email>{{ site.author.email | xml_escape }}</email> + </author> + + <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary> + </entry> + {% endif %} {% endfor %} -</feed> + +{% if is_audio %} + </channel> + </rss> +{% else %} + </feed> +{% 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 @@ <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1" /> <link rel="stylesheet" href="/styles.css" /> - <link rel="alternate" type="application/atom+xml" href="{{ site.t.articles.feed.url[page.lang] }}" hreflang="{{ page.lang}}" title="{{ site.t.articles.feed.title[page.lang] }}" /> - <link rel="alternate" type="application/atom+xml" href="{{ site.t.pastebins.feed.url[page.lang] }}" hreflang="{{ page.lang}}" title="{{ site.t.pastebins.feed.title[page.lang] }}" /> - <link rel="alternate" type="application/atom+xml" href="{{ site.t.tils.feed.url[page.lang] }}" hreflang="{{ page.lang}}" title="{{ site.t.tils.feed.title[page.lang] }}" /> - <link rel="alternate" type="application/atom+xml" href="{{ site.t.slides.feed.url[page.lang] }}" hreflang="{{ page.lang}}" title="{{ site.t.slides.feed.title[page.lang] }}" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.articles.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.articles.feed.title[page.lang] }}" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.pastebins.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.pastebins.feed.title[page.lang] }}" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.tils.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.tils.feed.title[page.lang] }}" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.slides.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.slides.feed.title[page.lang] }}" /> + <!-- <link rel="alternate" type="application/atom+xml" href="{{ site.t.podcasts.feed.url[page.lang] }}" hreflang="{{ page.lang }}" title="{{ site.t.podcasts.feed.title[page.lang] }}" /> --> <title>{{ page.title }} - EuAndreh</title> <meta property="og:site_name" content="{{ site.title }}" /> @@ -41,6 +42,7 @@ <a href="{% link {{ site.t.tils.url[page.lang] }} %}">{{ site.t.tils.name[page.lang] }}</a> <a href="{% link {{ site.t.slides.url[page.lang] }} %}">{{ site.t.slides.name[page.lang] }}</a> <a href="{% link {{ site.t.pastebins.url[page.lang] }} %}">{{ site.t.pastebins.name[page.lang] }}</a> + <!-- <a href="{% link {{ site.t.podcasts.url[page.lang] }} %}">{{ site.t.podcasts.name[page.lang] }}</a> --> <a href="{% link {{ site.t.about.url[page.lang] }} %}">{{ site.t.about.name[page.lang] }}</a> </div> {% 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 +--- + +<audio controls> + <source src="{% link /resources/podcasts/{{ page.lang }}/{{ page.date | date: "%Y-%m-%d" }}-{{ page.ref }}.ogg %}" type="audio/ogg"> + <source src="horse.ogg" type="audio/ogg"> +</audio> + +{{ 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 @@ -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 %} + ] } |