From 191728a2cac217e96a7f1e4e9a4710606f6ad920 Mon Sep 17 00:00:00 2001 From: EuAndreh Date: Wed, 12 Aug 2020 06:34:38 -0300 Subject: Add TILs section, with Atom support and i18n - add i18n logic to support translated TIL entries and listing; - make the website title less tied to a blog: "EuAndreh::blog" -> EuAndreh; - remove old Atom feed link aliases; - remove feed.all.atom and it's link in the about page; - create Atom feed for TIL entries; - show blog and TIL Atom feed on their listing pages (index and tils-listing); - add root alias: / -> /en/ - remove explicit list of feeds from $IGNORED_PAGES and use a '*.atom' glob instead; - also lint, assert-content and assert-unique-ref of TILs; - fix wrong "post.date" in pastebin entry in site.json; --- _config.yml | 72 +++++++++++++++-------- _includes/feed.atom | 20 +++---- _layouts/default.html | 46 ++++++++------- _layouts/index.html | 7 ++- _layouts/til.html | 11 ++++ _layouts/tils-listing.html | 18 ++++++ atom.xml | 1 - en/index.md | 5 ++ feed.all.atom | 4 -- feed.atom | 1 - feed.blog.en.atom | 4 ++ feed.blog.pt.atom | 4 ++ feed.en.atom | 4 -- feed.pt.atom | 4 -- feed.til.en.atom | 4 ++ feed.til.pt.atom | 4 ++ feed.xml | 1 - hea.md | 8 +++ index.md | 2 +- rss.xml | 1 - scripts/assert-content.sh | 13 +++- site.json | 18 +++++- sobre.md | 12 ---- til.md | 144 +-------------------------------------------- 24 files changed, 178 insertions(+), 230 deletions(-) create mode 100644 _layouts/til.html create mode 100644 _layouts/tils-listing.html delete mode 120000 atom.xml create mode 100644 en/index.md delete mode 100644 feed.all.atom delete mode 120000 feed.atom create mode 100644 feed.blog.en.atom create mode 100644 feed.blog.pt.atom delete mode 100644 feed.en.atom delete mode 100644 feed.pt.atom create mode 100644 feed.til.en.atom create mode 100644 feed.til.pt.atom delete mode 120000 feed.xml create mode 100644 hea.md delete mode 120000 rss.xml diff --git a/_config.yml b/_config.yml index 35e9d05..4990238 100644 --- a/_config.yml +++ b/_config.yml @@ -1,5 +1,5 @@ --- -title: EuAndreh::blog +title: EuAndreh url: "https://euandre.org" author: name: EuAndreh @@ -30,48 +30,68 @@ exclude: collections: pastebins: output: true + tils: + output: true t: about: en: "About" pt: "Sobre" about_url: - en: '/about.html' - pt: '/sobre.html' + en: "/about.html" + pt: "/sobre.html" + til: + en: "TIL" + pt: "HEA" + til_url: + en: "/til.html" + pt: "/hea.html" + til_listing: + en: "TIL Listing" + pt: "Lista de HEA" home: en: "EuAndreh's blog" pt: "Blog do EuAndreh" home_url: - en: '/' - pt: '/pt/' + en: "/en/" + pt: "/pt/" recent_posts: - en: 'Recent posts' - pt: 'Postagens recentes' - feed_title: - en: "EuAndreh's Feed" - pt: "Feed do EuAndreh" - feed_url: - en: '/feed.en.atom' - pt: '/feed.pt.atom' + en: "Recent posts" + pt: "Postagens recentes" + feed: + title: + blog: + en: "EuAndreh's blog feed" + pt: "Feed do blog do EuAndreh" + til: + en: "EuAndreh's TIL feed" + pt: "Feed do HEA do EuAndreh" + url: + blog: + en: "/feed.blog.en.atom" + pt: "/feed.blog.pt.atom" + til: + en: "/feed.til.en.atom" + pt: "/feed.til.pt.atom" date_format: - en: '%B %-d, %Y' - pt: '%-d de %B de %Y' + en: "%B %-d, %Y" + pt: "%-d de %B de %Y" posted_on: - en: 'Posted on' - pt: 'Postado em' + en: "Posted on" + pt: "Postado em" updated_at: - en: 'Updated at' - pt: 'Atualizado em' + en: "Updated at" + pt: "Atualizado em" alt: - blog_feed: - en: 'Blog feed' - pt: 'Feed do blog' + atom: + en: "Atom/RSS icon" + pt: "Ícone de Atom/RSS" envelope_icon: - en: 'Envelope icon' - pt: 'Ícone de envelope' + en: "Envelope icon" + pt: "Ícone de envelope" lock_icon: - en: 'Lock icon' - pt: 'Ícone de fechadura' + en: "Lock icon" + pt: "Ícone de fechadura" footer: en: >- The content for this site is licensed under CC-BY-SA. The code is GPLv3 or later. diff --git a/_includes/feed.atom b/_includes/feed.atom index bf0f4d4..5451702 100644 --- a/_includes/feed.atom +++ b/_includes/feed.atom @@ -6,29 +6,29 @@ {{ page.url | absolute_url | xml_escape }} {{ site.title | smartify | xml_escape }} - {{ site.t.feed_title[include.lang] | smartify | xml_escape }} + {{ site.t.feed.title[include.kind][include.lang] | smartify | xml_escape }} {{ site.author.name | xml_escape }} {{ site.author.email | xml_escape }} - {% for post in include.posts %} - - {{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }} - - {{ post.date | date_to_xmlschema }} - {{ post.updated_at | default: post.date | date_to_xmlschema }} - {{ post.url | absolute_url | xml_escape }} + {% for entry in include.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 }} - {{ post.content | strip | xml_escape }} + {{ entry.content | strip | xml_escape }} {{ site.author.name | xml_escape }} {{ site.author.email | xml_escape }} - {{ post.excerpt | strip_html | normalize_whitespace | xml_escape }} + {{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }} {% endfor %} diff --git a/_layouts/default.html b/_layouts/default.html index 6a0587b..f97f5ef 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -5,7 +5,7 @@ - + {{ page.title }} @@ -29,29 +29,35 @@ diff --git a/_layouts/index.html b/_layouts/index.html index 0ec683d..1ce99ca 100644 --- a/_layouts/index.html +++ b/_layouts/index.html @@ -1,7 +1,12 @@ --- layout: default --- -

{{ site.t.recent_posts[page.lang] }}

+

+ {{ site.t.recent_posts[page.lang] }} + + {{ site.t.alt.atom[page.lang] }} + +

{% assign lposts=site.posts | where:"lang", page.lang | sort: 'date' | reverse %} {% if lposts.size > 0 %}