diff --git a/.eleventy.js b/.eleventy.js index 09e6958..7d00e41 100644 --- a/.eleventy.js +++ b/.eleventy.js @@ -5,6 +5,17 @@ module.exports = function(eleventyConfig) { eleventyConfig.addPassthroughCopy("static"); +eleventyConfig.addNunjucksFilter("alternateLanguages", function(collection, postId, currentLanguageKey) { + return collection.filter(post => + post.data.postId === postId && post.data.langKey !== currentLanguageKey + ) + .map(post => ({ + lang: post.data.langKey, + url: post.url, + title: post.data.title + })) +}); + eleventyConfig.addNunjucksFilter("smartTitle", function(str) { if (!str) return ""; const smallWords = ["a","an","and","at","but","by","for","in","nor","of","on","or","so","the","to","up","yet", diff --git a/_data/i18n.js b/_data/i18n.js index cdd453b..e5f049c 100644 --- a/_data/i18n.js +++ b/_data/i18n.js @@ -15,6 +15,10 @@ const globalValues = { module.exports = { // global: globalValues, en: { + language: "english", + availableInOtherLanguages: "Also available in other languages", + pt: "portuguese", + en: "english", home: "home", welcome: "welcome", homeWelcomeParagraph: "It seems that you have found my website! Hi, I am Adrian Victor (or tenkuma), a Brazilian guy who likes to mess around with computers, computer programs and enimatpyrtlyhtemids.", @@ -53,6 +57,10 @@ module.exports = { options: "Options" }, pt: { + language: "português", + availableInOtherLanguages: "Também disponível em outros idiomas", + pt: "português", + en: "inglês", home: "início", welcome: "bem-vindo", homeWelcomeParagraph: "Parece que você encontrou meu website! Olá, sou Adrian Victor (ou tenkuma), um cara brasileiro que gosta de mexer com computadores, programas de computadores e enimatpirtlitemídios.", diff --git a/_includes/post.njk b/_includes/post.njk index e9d3bd2..49828c0 100644 --- a/_includes/post.njk +++ b/_includes/post.njk @@ -2,11 +2,22 @@ layout: base.njk title: Adrian Victor:Blog --- +{% set altLanguages = collections.post | alternateLanguages(postId, langKey) %}

{{ postTitle }}

{{ authors or "Adrian Victor" }} - {{ date }}

+ {% if altLanguages.length > 0 %} + {{ i18n[langKey].availableInOtherLanguages }}: + {% for alt in altLanguages %} +
  • + + {{ i18n[alt.lang].language }} + +
  • + {% endfor %} + {% endif %}
    {{ content | safe }}
    diff --git a/posts/android-developer-verification.html b/posts/android-developer-verification.html index b7af053..0a68f7e 100644 --- a/posts/android-developer-verification.html +++ b/posts/android-developer-verification.html @@ -1,5 +1,6 @@ --- postTitle: "On the Recent Changes to App Distribution Requirements in the Android System by Google." +postId: developer-verification langKey: en layout: post.njk date: 2025-08-30 diff --git a/posts/verificacao-de-desenvolvedor-no-android.html b/posts/verificacao-de-desenvolvedor-no-android.html index 652592e..f39b84a 100644 --- a/posts/verificacao-de-desenvolvedor-no-android.html +++ b/posts/verificacao-de-desenvolvedor-no-android.html @@ -1,5 +1,6 @@ --- postTitle: "Sobre as recentes mudanças nos requisitos de distribuição de apps no sistema Android feitas pela Google." +postId: developer-verification layout: post.njk date: 2025-08-30 background: android-jellybean.jpg diff --git a/static/main.css b/static/main.css index e15fc85..3192c2b 100644 --- a/static/main.css +++ b/static/main.css @@ -31,6 +31,10 @@ li { list-style-type: none; } +li.inlineList { + display: inline; +} + select { background-color: transparent; color: white;