diff options
-rw-r--r-- | 404.html | 4 | ||||
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | TODOs.org | 13 | ||||
-rw-r--r-- | _config.yml | 45 | ||||
-rw-r--r-- | _layouts/default.html | 38 | ||||
-rw-r--r-- | _layouts/index.html | 10 | ||||
-rw-r--r-- | _layouts/post.html | 23 | ||||
-rw-r--r-- | _posts/2018-07-17-rodando-guix-on-nixos.md | 8 | ||||
-rw-r--r-- | _posts/2018-07-17-running-guix-on-nixos.md | 2 | ||||
-rw-r--r-- | about.md | 2 | ||||
-rw-r--r-- | default.nix | 24 | ||||
-rw-r--r-- | index.md | 2 | ||||
-rw-r--r-- | pt/index.md | 5 | ||||
-rw-r--r-- | sobre.md | 7 | ||||
-rw-r--r-- | styles.css | 10 |
15 files changed, 143 insertions, 51 deletions
@@ -19,6 +19,6 @@ layout: default <div class="container"> <h1>404</h1> - <p><strong>Page not found :(</strong></p> - <p>The requested page could not be found.</p> + <p><strong>Page not found</strong></p> + <p><strong>Página não encontrada</strong></p> </div> @@ -5,5 +5,4 @@ gem "jekyll" group :jekyll_plugins do gem "jekyll-feed" gem "jekyll-seo-tag" - # gem "jekyll-multiple-languages-plugin" end @@ -1,6 +1,11 @@ * Tasks -** TODO Translate articles -https://groups.google.com/forum/#!topic/hakyll/KAhCO1GVELA -** TODO Spelling -** i18n page <head><title> +** Spelling ** i18n Feed title +** config.yml +** kramdown -> commonmark +** https://github.com/planetjekyll/awesome-jekyll-plugins/ +** change file naming strategy +use subfolders? +** Fix date formatting +** add sitemap +https://www.sylvaindurand.org/making-jekyll-multilingual/ diff --git a/_config.yml b/_config.yml index 0439307..2462bfd 100644 --- a/_config.yml +++ b/_config.yml @@ -1,3 +1,4 @@ +--- title: Your awesome title email: your-email@example.com description: >- @@ -7,13 +8,10 @@ description: >- baseurl: "" url: "url.com" -markdown: kramdown # FIXME +markdown: kramdown plugins: - jekyll-feed - jekyll-seo-tag - # - jekyll-multiple-languages-plugin - -# languages: ["en", "fr"] exclude: - Gemfile @@ -21,6 +19,7 @@ exclude: - gemset.nix - README - TODOs.org + - LICENSE - default.nix - utils.nix - shell.nix @@ -31,3 +30,41 @@ exclude: collections: pastebins: output: true + +t: + about: + en: "About" + pt: "Sobre" + home: + en: "EuAndreh's blog" + pt: "Blog do EuAndreh" + recent_posts: + en: 'Recent posts' + pt: 'Postagens recentes' + feed_title: + en: "EuAndreh's Feed" + pt: "Feed do EuAndreh" + feed_url: + en: '/feed.en.xml' + pt: '/feed.pt.xml' + date_format: + en: '%b %-d, %Y' + pt: '%b %-d, %Y' + posted_on: + en: 'Posted on' + pt: 'Postado em' + alt: + blog_feed: + en: 'Blog feed' + pt: 'Feed do blog' + envelope_icon: + en: 'Envelope icon' + pt: 'Ícone de envelope' + lock_icon: + 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>. + pt: >- + O conteúdo desse site é licensiado sob a licença <a rel="license" href="https://creativecommons.org/licenses/by-sa/4.0/">CC-BY-SA</a>. O <a href="https://git.sr.ht/~euandreh/website">código</a> é <a href="https://git.sr.ht/~euandreh/website/tree/master/LICENSE">GPLv3 ou versões maiores</a>. diff --git a/_layouts/default.html b/_layouts/default.html index 9fa116e..53b9830 100644 --- a/_layouts/default.html +++ b/_layouts/default.html @@ -1,23 +1,43 @@ <!DOCTYPE html> -<html lang="{{ page.lang | default: site.lang | default: "en" }}"> +<html lang="{{ page.lang | default: "en" }}"> <head> <meta charset="UTF-8"> <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="/feed.xml" title="EuAndreh's Feed" /> + <link rel="alternate" type="application/atom+xml" href="{{ site.t.feed_url[page.lang] }}" title="{{ site.t.feed_title[page.lang] }}" /> {%- seo -%} </head> <body> <header> <nav> <div id="nav-left"> - <a href="/">EuAndreh's blog</a> + <a href="/">{{ site.t.home[page.lang] }}</a> </div> <div id="nav-right"> - <a href="/about.html">About</a> - <a href="/feed.xml"> - <img class="simple-icon" src="/images/atom.svg" alt="Blog feed" /> + <ul> + {% if page.ref != nil %} + {% 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 %} + {% endif %} + + {% if page.ref != nil %} + {% 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 %} + {% endif %} + </ul> + + <a href="/about.html">{{ 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> @@ -31,16 +51,16 @@ <footer> <ul> <li> - <img class="simple-icon" src="/images/envelope.svg" alt="Envelope icon" /> + <img class="simple-icon" src="/images/envelope.svg" alt="{{ site.t.alt.envelope_icon[page.lang] }}" /> <a href="mailto:eu@euandre.org">eu@euandre.org</a> </li> <li> - <img class="simple-icon" src="/images/lock.svg" alt="Lock icon" /> + <img class="simple-icon" src="/images/lock.svg" alt="{{ site.t.alt.lock_icon[page.lang] }}" /> <a href="/public-key.txt">81F90EC3CD356060</a> </li> </ul> <p> - 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>. + {{ site.t.footer[page.lang] }} </p> </footer> </body> diff --git a/_layouts/index.html b/_layouts/index.html index 2c44ece..5b45898 100644 --- a/_layouts/index.html +++ b/_layouts/index.html @@ -1,11 +1,13 @@ --- layout: default --- -<h1>Recent posts</h1> +<h1>{{ site.t.recent_posts[page.lang] }}</h1> <ul> {%- for post in site.posts -%} - <li> - <a href="{{ post.url }}">{{ post.title | escape }}</a> - {{ post.date | date: "%b %-d, %Y" }} - </li> + {% if post.lang == page.lang %} + <li> + <a href="{{ post.url }}">{{ post.title | escape }}</a> - {{ post.date | date: "%b %-d, %Y" }} + </li> + {% endif %} {%- endfor -%} </ul> diff --git a/_layouts/post.html b/_layouts/post.html index bdaa3f8..b1b1412 100644 --- a/_layouts/post.html +++ b/_layouts/post.html @@ -3,17 +3,28 @@ layout: default --- <article> <section class="header"> - Posted on {{ page.date | date: "%b %-d, %Y" }} + {{ site.t.posted_on[page.lang] }} {{ page.date | date: site.t.date_format[page.lang] }} </section> <section> {{ content }} </section> <section> - <p>Have a comment on this post? Start a discussion - in my <a href="https://lists.sr.ht/~euandreh/public-inbox">public inbox</a> - by sending an email to <a href="mailto:~euandreh/public-inbox@lists.sr.ht?Subject=Re%3A%20{{ page.title | escape }}">~euandreh/public-inbox@lists.sr.ht</a> - [<a href="https://man.sr.ht/lists.sr.ht/etiquette.md">mailing list etiquette</a>], - or see <a href="https://lists.sr.ht/~euandreh/public-inbox?search={{ page.title | escape }}">existing discussions</a>. + <p> + {% if page.lang == 'en' %} + Have a comment on this post? Start a discussion in my + <a href="https://lists.sr.ht/~euandreh/public-inbox">public inbox</a> + by sending an email to + <a href="mailto:~euandreh/public-inbox@lists.sr.ht?Subject=Re%3A%20{{ page.title | escape }}">~euandreh/public-inbox@lists.sr.ht</a> + [<a href="https://man.sr.ht/lists.sr.ht/etiquette.md">mailing list etiquette</a>], + or see <a href="https://lists.sr.ht/~euandreh/public-inbox?search={{ page.title | escape }}">existing discussions</a>. + {% elsif page.lang == 'pt' %} + Tem um comentário sobre essa postagem? Comece uma discussão na minha + <a href="https://lists.sr.ht/~euandreh/public-inbox">caixa de entrada pública</a> + mandando um email para + <a href="mailto:~euandreh/public-inbox@lists.sr.ht?Subject=Re%3A%20{{ page.title | escape }}">~euandreh/public-inbox@lists.sr.ht</a> + [<a href="https://man.sr.ht/lists.sr.ht/etiquette.md">etiqueta da lista de email</a> (em inglês)], + ou procure por <a href="https://lists.sr.ht/~euandreh/public-inbox?search={{ page.title | escape }}">discussões existentes</a>. + {% endif %} </p> </section> </article> diff --git a/_posts/2018-07-17-rodando-guix-on-nixos.md b/_posts/2018-07-17-rodando-guix-on-nixos.md new file mode 100644 index 0000000..b449541 --- /dev/null +++ b/_posts/2018-07-17-rodando-guix-on-nixos.md @@ -0,0 +1,8 @@ +--- +title: Rodando Guix no NixOS +date: 2018-07-17 +layout: post +lang: pt +ref: running-guix-on-nixos +--- +Eu queria rodar Guix numa máquina com NixOS instalado. diff --git a/_posts/2018-07-17-running-guix-on-nixos.md b/_posts/2018-07-17-running-guix-on-nixos.md index 69a9d1a..c0d4611 100644 --- a/_posts/2018-07-17-running-guix-on-nixos.md +++ b/_posts/2018-07-17-running-guix-on-nixos.md @@ -2,6 +2,8 @@ title: Running Guix on NixOS date: 2018-07-17 layout: post +lang: en +ref: running-guix-on-nixos --- I wanted to run Guix on a NixOS machine. Even though the Guix manual explains how to do @@ -1,6 +1,8 @@ --- layout: page title: About +lang: en +ref: about --- Hi, I\'m EuAndreh. I write software and occasionally music. You can find my contact information in the footer of this page, or mail my [public diff --git a/default.nix b/default.nix index 78d2ce9..e79da46 100644 --- a/default.nix +++ b/default.nix @@ -13,37 +13,19 @@ in rec { gemset = ./gemset.nix; }; subtasks = rec { - hunspellCheck = utils.baseTask.overrideAttrs (baseAttrs: { - name = "${baseAttrs.name}-hunspell"; - buildInputs = baseAttrs.buildInputs - ++ [ (pkgs.hunspellWithDicts (with pkgs.hunspellDicts; [ en-us ])) ]; - buildPhase = '' - patchShebangs . - ./spelling/check-spelling.sh "${subtasks.docs}" - touch $out - ''; - }); docs = utils.baseTask.overrideAttrs (baseAttrs: { name = "${baseAttrs.name}-docs"; - src = ./site; - buildInputs = [ ]; + buildInputs = [ jekyllEnv ]; buildPhase = '' - export LOCALE_ARCHIVE="${pkgs.glibcLocales}/lib/locale/locale-archive"; - export LANG=en_US.UTF-8 - build-site build mkdir $out - cp -r _site/* $out + jekyll build -d $out ''; }); }; test = utils.test [ utils.formatNix (utils.shellcheck null) - (utils.fixme [ "pastebin/skeleton.org" "utils.nix" ]) - subtasks.perlPodCheck - subtasks.batsTest - subtasks.perlInternalTest - subtasks.hunspellCheck + (utils.fixme null) ]; shell = pkgs.mkShell rec { name = "website-shell"; @@ -1,3 +1,5 @@ --- layout: index +lang: en +ref: index --- diff --git a/pt/index.md b/pt/index.md new file mode 100644 index 0000000..2285152 --- /dev/null +++ b/pt/index.md @@ -0,0 +1,5 @@ +--- +layout: index +lang: pt +ref: index +--- diff --git a/sobre.md b/sobre.md new file mode 100644 index 0000000..ec3d3df --- /dev/null +++ b/sobre.md @@ -0,0 +1,7 @@ +--- +layout: page +title: Sobre +lang: pt +ref: about +--- +Oi, eu sou EuAndreh. @@ -25,6 +25,16 @@ nav a { text-decoration: none; } +nav ul, nav li { + display: inline; +} + +nav ul li a { + color: black; + font-size: 14px; + margin: 6px; +} + footer { border-top: solid 2px black; font-size: 14px; |