commit 904d615d30e83f5406531310f9ed4e4a94168a22
parent 043a9f4776f105b31c5c5fb54d76f5609d22f932
Author: Oscar Benedito <oscar@oscarbenedito.com>
Date: Fri, 18 Aug 2023 16:45:48 +0200
Added Catalan translation
Diffstat:
9 files changed, 157 insertions(+), 78 deletions(-)
diff --git a/assets/css/style.css b/assets/css/style.css
@@ -192,8 +192,8 @@ header#page-header .content nav a {
/* footer {{{ */
footer#page-footer {
- border-top: 2px solid var(--hr-color);
- padding: calc(1.5 * var(--gap)) var(--gap);
+ padding: 0 var(--gap);
+ margin: calc(1.5 * var(--gap)) 0;
}
footer#page-footer .content {
diff --git a/content/_index.html b/content/_index.html
@@ -1,23 +1,40 @@
<!-- priority: 1.0 -->
<!-- extraheader: <link rel="me" href="https://github.com/oscarbenedito"/><link rel="me" href="https://gitlab.com/oscarbenedito"/><link rel="me" href="mailto:oscar@oscarbenedito.com"/><link rel="pgpkey" href="/pgp/pubkey.asc"/> -->
-<!-- description: Hello and welcome to my website! I'm Oscar Benedito and this is my corner of the Internet. -->
+<!-- description: Benvinguts al meu web! Soc l'Oscar Benedito i aquest és el meu racó d'Internet. -->
+<!-- en-url: en/ -->
+
+<h1 style="text-align: center">Benvinguts, internautes!</h1>
<p>
- Hello and welcome to my website! My name is Oscar Benedito and I am a 25-year-old from Barcelona.
- I enjoy tinkering with and customizing computers and I often undertake small software projects for
- personal use. When away from a computer, I like to do sport (the particular sport varies depending
- on the season and year) and I occasionally juggle. I graduated in Mathematics and Computer
- Engineering from <a href="https://www.upc.edu/en">UPC</a> and I am currently working as a Software
- Engineer at Oracle.</p>
+ Benvinguts al meu web! Soc l'Oscar Benedito, tinc 25 anys i soc de Barcelona. M'agrada manipular i
+ personalitzar ordinadors i sovint faig petits programes per a ús personal. Quan estic lluny de
+ l'ordinador, m'agrada fer esport (l'esport concret varia segons l'època i l'any) i de tant en tant
+ faig malabars. Em vaig graduar en Matemàtiques i Enginyeria Informàtica per la
+ <a href="https://www.upc.edu">UPC</a> i actualment treballo com a Software Engineer a Oracle.</p>
<!-- /p -->
+<p>El contingut principal que tinc en línia és:</p>
+
+<ul>
+ <li><a href="/blog/">El meu blog</a>, on parlo de privacitat, programari i altres temes</li>
+ <li>
+ <a href="https://git.oscarbenedito.com">Els meus repositoris</a>, on es troba tot el meu codi
+ public</li>
+ <!-- /li -->
+ <li>
+ <a href="https://www.linkedin.com/in/oscarbenedito">El meu perfil de LinkedIn</a>, on hi ha més
+ informació sobre la meva vida acadèmica i professional</li>
+ <!-- /li -->
+</ul>
+
+<h2 id="contacte">Contacte</h2>
+
+<p>Em podeu contactar escrivint un correu electrònic a <a href="mailto:oscar@oscarbenedito.com">oscar@oscarbenedito.com</a>.</p>
+
<p>
- I encourage you to check out some of my content: <a href="/blog/">my blog</a>, where I talk about
- privacy, software and other related topics, or <a href="https://git.oscarbenedito.com">my Git
- repositories</a>. If you want to read more about my academic/professional life, check out <a
- href="https://www.linkedin.com/in/oscarbenedito">my LinkedIn profile</a>.</p>
+ Si voleu encriptar el vostre missatge utilitzant PGP, podeu utilitzar el Web Key Directory o
+ agafar la meva clau pública a <a href="/pgp/pubkey.asc">aquesta addreça</a>. L'empremta de la
+ meva clau PGP és:</p>
<!-- /p -->
-<h2>Contact me</h2>
-
-<p>Feel free to contact me! Details can be found on my <a href="/contact/">contact page</a>.</p>
+<pre><code>2D64 7040 7548 446A 3F35 D775 621D 67E0 9F48 82A6</code></pre>
diff --git a/content/about.html b/content/about.html
@@ -1,39 +0,0 @@
-<!-- title: About this site -->
-<!-- description: Information about the site: privacy, license and source code. -->
-
-<h2>Privacy</h2>
-
-<p>
- The site contains no ads or cross-site references. I am currently hosted by <a
- href="https://www.hetzner.com">Hetzner</a> and can't guarantee that they don't keep any logs of
- the website's visitors. I do keep logs for 14 days and use GoAccess to keep track of how many
- visitors I get. This information is not shared with anyone else.</p>
-<!-- /p -->
-
-<h2>Licenses</h2>
-
-<p>
- This site is powered by free software. The software is published under the <a
- href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License version 3</a>.</p>
-<!-- /p -->
-
-<p>
- The content of the site is published under a <a
- href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International
- License</a> unless otherwise stated.</p>
-<!-- /p -->
-
-<p>I am hosting local copies of the licenses: <a href="/licenses/gpl-3.0.txt">GPLv3</a>, <a href="/licenses/cc-by-4.0.txt">CC-BY-4.0</a>.</p>
-
-<h2>Source code</h2>
-
-<p>
- This site is genarated using <a href="https://git.oscarbenedito.com/oscarbenedito.com/file/gensite.py.html">gensite.py</a>,
- a small Python script based on <a href="https://github.com/sunainapai/makesite">makesite.py</a>.
- You can find the site's source code on <a href="https://git.oscarbenedito.com/oscarbenedito.com/">this repository</a>.</p>
-<!-- /p -->
-
-<p>
- You can find all the JavaScript run on the site along with the licenses and source code in the <a
- href="/jsweblabels/">JavaScript Web Labels page</a>.</p>
-<!-- /p -->
diff --git a/content/contact.html b/content/contact.html
@@ -1,20 +0,0 @@
-<!-- title: Contact -->
-<!-- description: Contact information. -->
-
-<p>You can contact me sending an email to <a href="mailto:oscar@oscarbenedito.com">oscar@oscarbenedito.com</a>.</p>
-
-<h2>Encrypt your message</h2>
-
-<p>
- If you want to encrypt your message using PGP, you can either use the Web Key Directory standard
- or get my public key from <a href="/pgp/pubkey.asc" title="Oscar Benedito's public PGP key">this
- address</a>. My PGP key fingerprint is:</p>
-<!-- /p -->
-
-<pre><code>2D64 7040 7548 446A 3F35 D775 621D 67E0 9F48 82A6</code></pre>
-
-<p>
- If you don't know how to use PGP but still want to encrypt your message, you can use <a
- href="https://keyoxide.org/oscar@oscarbenedito.com" title="Keyoxide profile">Keyoxide</a> at your
- own risk.</p>
-<!-- /p -->
diff --git a/content/en/_index.html b/content/en/_index.html
@@ -0,0 +1,38 @@
+<!-- priority: 0.9 -->
+<!-- extraheader: <link rel="me" href="https://github.com/oscarbenedito"/><link rel="me" href="https://gitlab.com/oscarbenedito"/><link rel="me" href="mailto:oscar@oscarbenedito.com"/><link rel="pgpkey" href="/pgp/pubkey.asc"/> -->
+<!-- description: Hello and welcome to my website! I'm Oscar Benedito and this is my corner of the Internet. -->
+<!-- ca-url: -->
+
+<h1 style="text-align: center">Welcome, internauts!</h1>
+
+<p>
+ Hello and welcome to my website! My name is Oscar Benedito and I am a 25-year-old from Barcelona.
+ I enjoy tinkering with and customizing computers and I often undertake small software projects for
+ personal use. When away from a computer, I like to do sport (the particular sport varies depending
+ on the season and year) and I occasionally juggle. I graduated in Mathematics and Computer
+ Engineering from <a href="https://www.upc.edu/en">UPC</a> and I am currently working as a Software
+ Engineer at Oracle.</p>
+<!-- /p -->
+
+<p>The main content I have online is:</p>
+
+<ul>
+ <li><a href="/blog/">My blog</a>, where I talk about privacy, software and other topics</li>
+ <li><a href="https://git.oscarbenedito.com">My repositories</a>, where all my public code is hosted</li>
+ <li>
+ <a href="https://www.linkedin.com/in/oscarbenedito">My LinkedIn profile</a>, where you can find
+ more information about my academic and professional life</li>
+ <!-- /li -->
+</ul>
+
+<h2 id="contact-me">Contact me</h2>
+
+<p>You can contact me sending an email to <a href="mailto:oscar@oscarbenedito.com">oscar@oscarbenedito.com</a>.</p>
+
+<p>
+ If you want to encrypt your message using PGP, you can either use the Web Key Directory standard
+ or get my public key from <a href="/pgp/pubkey.asc" title="Oscar Benedito's public PGP key">this
+ address</a>. My PGP key fingerprint is:</p>
+<!-- /p -->
+
+<pre><code>2D64 7040 7548 446A 3F35 D775 621D 67E0 9F48 82A6</code></pre>
diff --git a/content/en/about.html b/content/en/about.html
@@ -0,0 +1,35 @@
+<!-- title: About this site -->
+<!-- description: Information about the site: privacy, licenses and source code. -->
+<!-- ca-url: sobre/ -->
+
+<h2>Privacy</h2>
+
+<p>
+ The site contains no ads nor runs internal or external code to track users. It is currently hosted
+ by <a href="https://www.hetzner.com">Hetzner</a> and I can't guarantee that they don't keep any
+ logs of the website's visitors. I do keep the server logs for 14 days and use GoAccess to keep
+ track of how many visits I get. This information is not shared with anyone else.</p>
+<!-- /p -->
+
+<h2>Source code and licenses</h2>
+
+<p>
+ This site is powered by free software. It is genarated using
+ <a href="https://git.oscarbenedito.com/oscarbenedito.com/file/gensite.py.html">gensite.py</a>, a
+ Python script based on <a href="https://github.com/sunainapai/makesite">makesite.py</a> and
+ published under the <a href="https://www.gnu.org/licenses/gpl-3.0.html">GNU General Public License version 3</a>.
+ The content of the site is published under the
+ <a href="https://creativecommons.org/licenses/by/4.0/">Creative Commons Attribution 4.0 International License</a>
+ unless otherwise stated.</p>
+<!-- /p -->
+
+<p>
+ You can find the site's source code <a href="https://git.oscarbenedito.com/oscarbenedito.com/">here</a>.
+ All the JavaScript code run on the site along with its licenses and source code is listed in the
+ <a href="/jsweblabels/">JavaScript Web Labels page</a>.</p>
+<!-- /p -->
+
+<p>
+ You can find local copies of the licenses here: <a href="/licenses/gpl-3.0.txt">GPLv3</a>,
+ <a href="/licenses/cc-by-4.0.txt">CC-BY-4.0</a>.</p>
+<!-- /p -->
diff --git a/content/sobre.html b/content/sobre.html
@@ -0,0 +1,35 @@
+<!-- title: Sobre el web -->
+<!-- description: Informació sobre el web: privacitat, llicències i codi font. -->
+<!-- en-url: en/about/ -->
+
+<h2>Privacitat</h2>
+
+<p>
+ Aquest web no conté anuncis ni corre codi intern ni extern per a rastrejar usuaris. Actualment
+ està allotjat per <a href="https://www.hetzner.com">Hetzner</a> i no puc garantir que no guardin
+ cap registre dels visitants del lloc web. Jo si que conservo els logs del servidor durant 14 dies
+ i faig servir GoAccess per fer saber quantes visites rebo. Aquesta informació no es comparteix amb
+ ningú més.</p>
+<!-- /p -->
+
+<h2>Codi font i llicències</h2>
+
+<p>
+ Aquest web funciona amb programari lliure. Està generat usant
+ <a href="https://git.oscarbenedito.com/oscarbenedito.com/file/gensite.py.html">gensite.py</a>, un
+ script de Python basat en <a href="https://github.com/sunainapai/makesite">makesite.py</a> i
+ publicat sota la <a href="https://www.gnu.org/licenses/gpl-3.0.html">Llicència Pública General de
+ GNU versió 3</a>. El contingut del web està públicat sota la llicència
+ <a href="https://creativecommons.org/licenses/by/4.0/">Reconeixement 4.0 Internacional de Creative
+ Commons</a> llevat que s'indiqui el contrari.</p>
+<!-- /p -->
+
+<p>
+ Podeu trobar el codi font del web <a href="https://git.oscarbenedito.com/oscarbenedito.com/">aquí</a>.
+ I tot el codi JavaScript que conté el web junt amb les seves llicències <a href="/jsweblabels/">aquí</a>.</p>
+<!-- /p -->
+
+<p>
+ Podeu trobar una còpia local de les llicències aquí: <a href="/licenses/gpl-3.0.txt">GPLv3</a>,
+ <a href="/licenses/cc-by-4.0.txt">CC-BY-4.0</a>.</p>
+<!-- /p -->
diff --git a/gensite.py b/gensite.py
@@ -134,6 +134,9 @@ def render(template, pre=False, **params):
template = re.sub(r'{{\s*_if\s+([^}\s]+)\s*}}(.*?){{\s*_fi\s*}}',
lambda m: m.group(2) if m.group(1) in params else '',
template, flags=re.DOTALL)
+ template = re.sub(r'{{\s*_ife\s+([^}\s]+)\s*}}(.*?){{\s*_else\s*}}(.*?){{\s*_fi\s*}}',
+ lambda m: m.group(2) if m.group(1) in params else m.group(3),
+ template, flags=re.DOTALL)
return re.sub(r'{{\s*([^}\s]+)\s*}}',
lambda m: str(params.get(m.group(1), m.group(0))),
template)
@@ -396,6 +399,8 @@ def main():
make_pages('content/_index.html', '', l_page, **params)
make_pages('content/[!_]*.*', '{{ slug }}/', l_page, **params)
make_pages('content/projects/[!_]*.*', 'projects/{{ slug }}/', l_page, **params)
+ make_pages('content/en/_index.html', 'en/', l_page, **params)
+ make_pages('content/en/[!_]*.*', 'en/{{ slug }}/', l_page, **params)
fwrite('404.html', render(fread('layouts/404.html'), **params))
# create blog post pages
@@ -421,6 +426,8 @@ def main():
set_redirect('licenses/gpl-v3/', 'licenses/gpl-3.0.txt')
set_redirect('licenses/cc-by-4.0/', 'licenses/cc-by-4.0.txt')
set_redirect('composer/', 'projects/composer/composer.html')
+ set_redirect('contact/', 'en/#contact-me')
+ set_redirect('about/', 'en/about/')
fwrite('sitemap.xml', sitemap + '</urlset>')
diff --git a/layouts/base.html b/layouts/base.html
@@ -15,14 +15,20 @@
<body>
<header id="page-header">
<div class="content">
- <a href="/" class="logo" title="Home">Oscar Benedito</a>
- <nav><a href="/blog/">Blog</a> · <a href="/contact/">Contact</a> · <a href="https://git.oscarbenedito.com">Git</a></nav>
+ <a href="/{{ _ife en-url }}{{ _else }}en/{{ _fi }}" class="logo" title="{{ _ife en-url }}Inici{{ _else }}Home{{ _fi }}">Oscar Benedito</a>
+ <nav>
+ {{ _if ca-url }}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="stroke: none; vertical-align: middle; height: 0.9em;"><path d="M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg> <a href="/{{ ca-url }}">Català</a> ·{{ _fi }}
+ {{ _if en-url }}<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" style="stroke: none; vertical-align: middle; height: 0.9em;"><path d="M18.5 10l4.4 11h-2.155l-1.201-3h-4.09l-1.199 3h-2.154L16.5 10h2zM10 2v2h6v2h-1.968a18.222 18.222 0 0 1-3.62 6.301 14.864 14.864 0 0 0 2.336 1.707l-.751 1.878A17.015 17.015 0 0 1 9 13.725a16.676 16.676 0 0 1-6.201 3.548l-.536-1.929a14.7 14.7 0 0 0 5.327-3.042A18.078 18.078 0 0 1 4.767 8h2.24A16.032 16.032 0 0 0 9 10.877a16.165 16.165 0 0 0 2.91-4.876L2 6V4h6V2h2zm7.5 10.885L16.253 16h2.492L17.5 12.885z"/></svg> <a href="/{{ en-url }}">English</a> ·{{ _fi }}
+ <a href="/blog/">Blog{{ _if en-url }} (en anglès){{ _fi }}</a> ·
+ <a href="https://git.oscarbenedito.com">Git</a> <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 512 512" style="height: 0.7em; margin-bottom: 0.05em;"><path d="M320 0c-17.7 0-32 14.3-32 32s14.3 32 32 32h82.7L201.4 265.4c-12.5 12.5-12.5 32.8 0 45.3s32.8 12.5 45.3 0L448 109.3V192c0 17.7 14.3 32 32 32s32-14.3 32-32V32c0-17.7-14.3-32-32-32H320zM80 32C35.8 32 0 67.8 0 112V432c0 44.2 35.8 80 80 80H400c44.2 0 80-35.8 80-80V320c0-17.7-14.3-32-32-32s-32 14.3-32 32V432c0 8.8-7.2 16-16 16H80c-8.8 0-16-7.2-16-16V112c0-8.8 7.2-16 16-16H192c17.7 0 32-14.3 32-32s-14.3-32-32-32H80z"/></svg>
+ </nav>
</div>
</header>
{{ content }}
<footer id="page-footer">
<div class="content">
- © 2019-2023 Oscar Benedito · <a href="https://git.oscarbenedito.com/oscarbenedito.com/">Source code</a> · <a href="/about/">About this site</a>
+ © 2019-2023 Oscar Benedito ·
+ {{ _ife en-url }}<a href="/sobre/">Sobre el web</a>{{ _else }}<a href="/en/about/">About this site</a>{{ _fi }}
</div>
</footer>{{ _if extrafooter }}
{{ extrafooter }}{{ _fi }}