diff options
-rw-r--r-- | _config.yml | 72 | ||||
-rw-r--r-- | _includes/feed.atom | 20 | ||||
-rw-r--r-- | _layouts/default.html | 46 | ||||
-rw-r--r-- | _layouts/index.html | 7 | ||||
-rw-r--r-- | _layouts/til.html | 11 | ||||
-rw-r--r-- | _layouts/tils-listing.html | 18 | ||||
l--------- | atom.xml | 1 | ||||
-rw-r--r-- | en/index.md | 5 | ||||
-rw-r--r-- | feed.all.atom | 4 | ||||
l--------- | feed.atom | 1 | ||||
-rw-r--r-- | feed.blog.en.atom (renamed from feed.en.atom) | 2 | ||||
-rw-r--r-- | feed.blog.pt.atom (renamed from feed.pt.atom) | 2 | ||||
-rw-r--r-- | feed.til.en.atom | 4 | ||||
-rw-r--r-- | feed.til.pt.atom | 4 | ||||
l--------- | feed.xml | 1 | ||||
-rw-r--r-- | hea.md | 8 | ||||
-rw-r--r-- | index.md | 2 | ||||
l--------- | rss.xml | 1 | ||||
-rwxr-xr-x | scripts/assert-content.sh | 13 | ||||
-rw-r--r-- | site.json | 18 | ||||
-rw-r--r-- | sobre.md | 12 | ||||
-rw-r--r-- | til.md | 144 |
22 files changed, 172 insertions, 224 deletions
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: <web>EuAndreh</web> 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 <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA</a>. The <a href="https://git.sr.ht/~euandreh/website">code</a> is <a href="https://git.sr.ht/~euandreh/website/tree/master/LICENSE">GPLv3 or later</a>. 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 @@ <id>{{ page.url | absolute_url | xml_escape }}</id> <title type="html">{{ site.title | smartify | xml_escape }}</title> - <subtitle>{{ site.t.feed_title[include.lang] | smartify | xml_escape }}</subtitle> + <subtitle>{{ site.t.feed.title[include.kind][include.lang] | smartify | xml_escape }}</subtitle> <author> <name>{{ site.author.name | xml_escape }}</name> <email>{{ site.author.email | xml_escape }}</email> </author> - {% for post in include.posts %} - <entry xml:lang="{{ post.lang }}"> - <title type="html">{{ post.title | smartify | strip_html | normalize_whitespace | xml_escape }}</title> - <link href="{{ post.url | absolute_url }}" rel="alternate" type="text/html" title="{{ post.title | xml_escape }}" /> - <published>{{ post.date | date_to_xmlschema }}</published> - <updated>{{ post.updated_at | default: post.date | date_to_xmlschema }}</updated> - <id>{{ post.url | absolute_url | xml_escape }}</id> + {% for entry in include.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="{{ post.url | absolute_url | xml_escape }}">{{ post.content | strip | xml_escape }}</content> + <content type="html" xml:base="{{ entry.url | absolute_url | xml_escape }}">{{ entry.content | strip | xml_escape }}</content> <author> <name>{{ site.author.name | xml_escape }}</name> <email>{{ site.author.email | xml_escape }}</email> </author> - <summary type="html">{{ post.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary> + <summary type="html">{{ entry.excerpt | strip_html | normalize_whitespace | xml_escape }}</summary> </entry> {% endfor %} </feed> 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 @@ <meta http-equiv="X-UA-Compatible" content="IE=edge"> <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.feed_url[page.lang] }}" title="{{ site.t.feed_title[page.lang] }}" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.feed_url[page.lang] }}" title="{{ site.t.feed.title[page.lang] }}" /> <title>{{ page.title }}</title> <meta property="og:site_name" content="{{ site.title }}" /> @@ -29,29 +29,35 @@ </div> <div id="nav-right"> {% if page.ref != nil %} - {% if site.posts.size > 0 or site.pages.size > 0 %} - <ul> - {% assign lposts=site.posts | where:"ref", page.ref | sort: 'lang' %} - {% for lpost in lposts %} - <li> - <a href="{{ lpost.url }}" class="{{ lpost.lang }}">{{ lpost.lang }}</a> - </li> - {% endfor %} + <ul> + {% assign lposts=site.posts | where:"ref", page.ref | sort: 'lang' %} + {% for lpost in lposts %} + <li> + <a href="{{ lpost.url }}" class="{{ lpost.lang }}">{{ lpost.lang }}</a> + </li> + {% endfor %} + {% if page.ref == "root" %} + {% assign lpages=site.pages | where:"ref", "index" | sort: 'lang' %} + {% else %} {% assign lpages=site.pages | where:"ref", page.ref | sort: 'lang' %} - {% for lpage in lpages %} - <li> - <a href="{{ lpage.url }}" class="{{ lpage.lang }}">{{ lpage.lang }}</a> - </li> - {% endfor %} - </ul> - {% endif %} - {% endif %} + {% endif %} + {% for lpage in lpages %} + <li> + <a href="{{ lpage.url }}" class="{{ lpage.lang }}">{{ lpage.lang }}</a> + </li> + {% endfor %} + {% assign ltils=site.tils | where:"ref", page.ref | sort: 'lang' %} + {% for ltil in ltils %} + <li> + <a href="{{ ltil.url }}" class="{{ ltil.lang }}">{{ ltil.lang }}</a> + </li> + {% endfor %} + </ul> + {% endif %} + <a href="{{ site.t.til_url[page.lang] }}">{{ site.t.til[page.lang] }}</a> <a href="{{ site.t.about_url[page.lang] }}">{{ site.t.about[page.lang] }}</a> - <a href="{{ site.t.feed_url[page.lang] }}"> - <img class="simple-icon" src="/images/atom.svg" alt="{{ site.t.alt.blog_feed[page.lang] }}" /> - </a> </div> </nav> </header> 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 --- -<h1>{{ site.t.recent_posts[page.lang] }}</h1> +<h1> + {{ site.t.recent_posts[page.lang] }} + <a href="{{ site.t.feed.url.blog[page.lang] }}"> + <img class="simple-icon" src="/images/atom.svg" alt="{{ site.t.alt.atom[page.lang] }}" /> + </a> +</h1> {% assign lposts=site.posts | where:"lang", page.lang | sort: 'date' | reverse %} {% if lposts.size > 0 %} <ul> diff --git a/_layouts/til.html b/_layouts/til.html new file mode 100644 index 0000000..1a70d3b --- /dev/null +++ b/_layouts/til.html @@ -0,0 +1,11 @@ +--- +layout: default +--- +<article> + <section class="header"> + {{ site.t.posted_on[page.lang] }} {{ page.date | date: site.t.date_format[page.lang] }} + </section> + <section> + {{ content }} + </section> +</article> diff --git a/_layouts/tils-listing.html b/_layouts/tils-listing.html new file mode 100644 index 0000000..e254125 --- /dev/null +++ b/_layouts/tils-listing.html @@ -0,0 +1,18 @@ +--- +layout: default +--- +<h1> + {{ site.t.til_listing[page.lang] }} + <a href="{{ site.t.feed.url.til[page.lang] }}"> + <img class="simple-icon" src="/images/atom.svg" alt="{{ site.t.alt.atom[page.lang] }}" /> + </a> +</h1> +{{ content }} +<ul> + {% assign tils = site.tils | where:"lang", page.lang | sort: "date" | reverse %} + {%- for til in tils -%} + <li> + <a href="{{ til.url | relative_url }}">{{ til.title | escape }}</a> - {{ til.date | date: site.t.date_format[page.lang] }} + </li> + {%- endfor -%} +</ul> diff --git a/atom.xml b/atom.xml deleted file mode 120000 index 5291931..0000000 --- a/atom.xml +++ /dev/null @@ -1 +0,0 @@ -feed.en.atom
\ No newline at end of file diff --git a/en/index.md b/en/index.md new file mode 100644 index 0000000..28cca27 --- /dev/null +++ b/en/index.md @@ -0,0 +1,5 @@ +--- +layout: index +lang: en +ref: index +--- diff --git a/feed.all.atom b/feed.all.atom deleted file mode 100644 index 381dd63..0000000 --- a/feed.all.atom +++ /dev/null @@ -1,4 +0,0 @@ ---- ---- -{% assign lposts = site.posts | sort: "date" | reverse %} -{% include feed.atom posts=lposts lang="en" %}
\ No newline at end of file diff --git a/feed.atom b/feed.atom deleted file mode 120000 index 5291931..0000000 --- a/feed.atom +++ /dev/null @@ -1 +0,0 @@ -feed.en.atom
\ No newline at end of file diff --git a/feed.en.atom b/feed.blog.en.atom index a048a54..f4ac787 100644 --- a/feed.en.atom +++ b/feed.blog.en.atom @@ -1,4 +1,4 @@ --- --- {% assign lposts = site.posts | where:"lang", "en" | sort: "date" | reverse %} -{% include feed.atom posts=lposts lang="en" %}
\ No newline at end of file +{% include feed.atom entries=lposts kind="blog" lang="en" %}
\ No newline at end of file diff --git a/feed.pt.atom b/feed.blog.pt.atom index 9862e38..b697b28 100644 --- a/feed.pt.atom +++ b/feed.blog.pt.atom @@ -1,4 +1,4 @@ --- --- {% assign lposts = site.posts | where:"lang", "pt" | sort: "date" | reverse %} -{% include feed.atom lang="pt" %} +{% include feed.atom entries=lposts kind="blog" lang="pt" %} diff --git a/feed.til.en.atom b/feed.til.en.atom new file mode 100644 index 0000000..2c64b8e --- /dev/null +++ b/feed.til.en.atom @@ -0,0 +1,4 @@ +--- +--- +{% assign ltils = site.tils | where:"lang", "en" | sort: "date" | reverse %} +{% include feed.atom entries=ltils kind="til" lang="en" %}
\ No newline at end of file diff --git a/feed.til.pt.atom b/feed.til.pt.atom new file mode 100644 index 0000000..ab98fae --- /dev/null +++ b/feed.til.pt.atom @@ -0,0 +1,4 @@ +--- +--- +{% assign ltils = site.tils | where:"lang", "pt" | sort: "date" | reverse %} +{% include feed.atom entries=ltils kind="tils" lang="pt" %} diff --git a/feed.xml b/feed.xml deleted file mode 120000 index 5291931..0000000 --- a/feed.xml +++ /dev/null @@ -1 +0,0 @@ -feed.en.atom
\ No newline at end of file @@ -0,0 +1,8 @@ +--- +layout: tils-listing +lang: pt +ref: tils +--- +**H**oje **E**u **A**prendi (do inglês, _**T**oday **I** **L**earned_): pequenas postages de conhecimentos úteis. + +Cópia descarada da [Anna e só](https://til.flourishing.stream/). @@ -1,5 +1,5 @@ --- layout: index lang: en -ref: index +ref: root --- diff --git a/rss.xml b/rss.xml deleted file mode 120000 index 5291931..0000000 --- a/rss.xml +++ /dev/null @@ -1 +0,0 @@ -feed.en.atom
\ No newline at end of file diff --git a/scripts/assert-content.sh b/scripts/assert-content.sh index 7448c61..d83ec33 100755 --- a/scripts/assert-content.sh +++ b/scripts/assert-content.sh @@ -34,7 +34,8 @@ get-ref() { } get-url() { - echo "${1}" | base64 --decode | jq -r .url + # Remove leading / to match more closely the filesystem hierarchy + echo "${1}" | base64 --decode | jq -r .url | sed 's_^/__' } get-date() { @@ -69,7 +70,7 @@ for post in $(jq -r '.posts[] | @base64' "${JSON}"); do done echo Linting pages... >&2 -IGNORED_PAGES=(/site.json /sitemap.xml /rss.xml /atom.xml /feed.atom /feed.xml /feed.all.atom /feed.en.atom /feed.pt.atom) +IGNORED_PAGES=(site.json sitemap.xml *.atom) for page in $(jq -r '.pages[] | @base64' "${JSON}"); do URL="$(get-url "$page")" if ! contains-element "${URL}" "${IGNORED_PAGES[@]}"; then @@ -82,6 +83,11 @@ for pastebin in $(jq -r '.pastebins[] | @base64' "${JSON}"); do assert-frontmatter "$pastebin" done +echo Linting tils... >&2 +for til in $(jq -r '.tils[] | @base64' "${JSON}"); do + assert-frontmatter "$til" +done + echo Asserting unique refs... >&2 KNOWN_IDS=() assert-unique-ref() { @@ -96,6 +102,8 @@ assert-unique-ref() { printf '%s\n' "${KNOWN_IDS[@]}" red "Duplicated lang:ref match: '${ID}'." >&2 red "Page: ${URL}." >&2 + echo "$page" | base64 --decode | jq + exit 1 fi @@ -106,5 +114,6 @@ assert-unique-ref() { assert-unique-ref "$(jq -r '.pages[] | @base64' "${JSON}")" assert-unique-ref "$(jq -r '.posts[] | @base64' "${JSON}")" +assert-unique-ref "$(jq -r '.tils[] | @base64' "${JSON}")" echo Done. >&2 @@ -9,6 +9,7 @@ "url": "{{ post.url }}", "lang": "{{ post.lang }}", "ref": "{{ post.ref }}", + "layout": "post", "content": {{ post.content | strip_html | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} @@ -20,6 +21,7 @@ "url": "{{ page.url }}", "lang": "{{ page.lang }}", "ref": "{{ page.ref }}", + "layout": "page", "content": {{ page.content | strip_html | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} @@ -28,12 +30,26 @@ {% for pastebin in site.pastebins %} { "title": "{{ pastebin.title | smartify }}", - "date": "{{ post.date }}", + "date": "{{ pastebin.date }}", "url": "{{ pastebin.url }}", "lang": "{{ pastebin.lang }}", "ref": "pastebin-ref", + "layout": "pastebin", "content": {{ pastebin.content | strip_html | jsonify }} }{% unless forloop.last %},{% endunless %} {% endfor %} + ], + "tils": [ + {% for til in site.tils %} + { + "title": "{{ til.title | smartify }}", + "date": "{{ til.date }}", + "url": "{{ til.url }}", + "lang": "{{ til.lang }}", + "ref": "{{ til.ref }}", + "layout": "til", + "content": {{ til.content | strip_html | jsonify }} + }{% unless forloop.last %},{% endunless %} + {% endfor %} ] } @@ -15,18 +15,6 @@ trabalhos relacionados. Abaixo você encontra alguns projetos interessantes meus. -<!-- ## Projetos de software --> - -<!-- ### [cool-read-macros](./cool-read-macros/) --> - -<!-- ### [cl-BSON](./cl-bson/) --> - -<!-- [cl-intbytes](./cl-intbytes/) como consequência. --> - ## Outros [Lista de pastebins](./pastebins.html) (em inglês). - -[TIL: Useful code snippets](./til.html) (em inglês). - -[Feed Atom com todos os idiomas](./feed.all.atom). @@ -1,146 +1,8 @@ --- -layout: page -title: "TIL: Useful code snippets" +layout: tils-listing lang: en -ref: til +ref: tils --- - -### Bash variables - -```shell -$ which git -/run/current-system/sw/bin/git -$ readlink $(!!) -readlink $(which git) -/nix/store/5bgr1xpm4m0r72h9049jbbhagxdyrnyb-git-2.28.0/bin/git -``` - -### Git custom work-tree checkout - -```shell -git --work-tree=/path/to/outputdir checkout HEAD -- . -``` -### Search in Git - -Search log messages - -```shell -git log --grep='Build 0051' -``` - -Search content in git history - -```shell -git grep 'Build 0051' $(git rev-list --all) -``` -### Find broken symlinks - -```shell -find . -xtype l -``` - -### Kernel version -```shell -uname -r -``` -### Sending email through the command line - -```shell -mail eu@euandre.org -s "This is the subject" -aFrom:eu@euandre.org <<< 'This is the message' -``` - -### Git bisecting - -Automatic Git bisect - -```shell -git bisect start e1fd0a817d192c5a5df72dd7422e36558fa78e46 HEAD -git bisect run sh -c 'git clean -ffdx && ./bootstrap && ./configure --localstatedir=/var && make && git checkout' -``` - -### UNIX searching commands - -```shell -$ which gcc -$ locate signal.h -$ updatedb # add to cron? -``` - -### Guix contributing - -```shell -$ cd ~/dev/guix/guix/ -$ git clean -ffdx -$ guix environment guix # guix environment guix --ad-hoc help2man git strace -$ ./bootstrap -$ ./configure --localstatedir=/var -$ make -$ ./pre-inst-env guix describe -$ ./pre-inst-env guix show $PKG -$ ./pre-inst-env guix build $PKG -$ ./pre-inst-env guix lint $PKG -``` - -v2: -```shell -guix environment --pure guix --ad-hoc help2man git strace -- sh -c "./bootstrap && ./configure --localstatedir=/var && make" -``` - -v3: -```shell -$ guix environment --pure guix --ad-hoc help2man git stract -$ ./bootstrap -$ ./configure --localstatedir=/var -$ make -$ ./pre-inst-env guix build $PKG -$ ./pre-inst-env guix lint $PKG -$ ./pre-inst-env guix refresh --list-dependent $PKG -$ ./pre-inst-env guix build --rounds=2 $PKG -$ ./etc/ident-code.el $PKG -``` - -### git mail patches - -Check the [guix-devel thread][0] on -named "Re: [External] Re: New outreachy participant introduction". - -[0]: https://lists.gnu.org/archive/html/guix-devel/2019-10/msg00093.html - -### Flutter Dart `patchelf` - -```shell -patchelf --set-interpreter $(cat $NIX_CC/nix-support/dynamic-linker) /home/andreh/dev/misc/flutter/bin/cache/dart-sdk/bin/dart -``` - -### builds.sr.ht environment variables - -[https://builds.sr.ht/~euandreh/job/68005](https://builds.sr.ht/~euandreh/job/68005). - -### `C-c M-m` in message-mode for creating `cut here` sections - -Or run the `scissors` function. - -### Software Recomendations StackExchange exists - -[https://softwarerecs.stackexchange.com/](https://softwarerecs.stackexchange.com/). - -### GPG key search - -```shell -gpg --search-key eu@euandre.org -``` - -### Git Annex wanted - -```shell -git annex wanted . 'exclude=Banshee/old-musics/* and exclude=attic/videos/* and exclude=Photos/*' -``` - -### Useful keybindings -- `SPC v` for region selection -- `SPC j s` to split sexp -- `mod-shift-space` reset layout - -## Acknowledgements +**T**oday **I** **L**earned: small entries of useful knowledge.</p> Shameless rip-off of [Anna e só](https://til.flourishing.stream/). |