Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ feat: add multilingual support #80

Merged
merged 14 commits into from
May 25, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# tabi

A fast, lightweight, and modern [Zola](https://getzola.org) theme. It aims to be a personal page and home to blog posts.
A fast, lightweight, and modern [Zola](https://getzola.org) theme with multi-language support. It aims to be a personal page and home to blog posts.

See a live preview [here](https://welpo.github.io/tabi).

Expand All @@ -14,6 +14,7 @@ tabi has a perfect score on Google's Lighthouse audit:

## Features

- [X] Multi-language support.
- [X] Dark and light themes. Defaults to the OS setting, with a switcher in the navigation bar.
- [X] Perfect Lighthouse score (Performance, Accessibility, Best Practices and SEO).
- [X] [KaTeX](https://katex.org/) support.
Expand All @@ -27,8 +28,6 @@ tabi has a perfect score on Google's Lighthouse audit:
- [X] [Custom shortcodes](./templates/shortcodes/).
- [X] Customizable secure headers.

See the project's roadmap [here](https://github.com/users/welpo/projects/1).

## Quick start

```bash
Expand Down
97 changes: 90 additions & 7 deletions config.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
# Necessary stuff.
base_url = "https://welpo.github.io/tabi"
title = "~/tabi"
description = "tabi is a simple personal site and blogging theme for Zola."
description = "tabi is a fast, lightweight, and modern Zola theme with multi-language support, optional JavaScript, and a perfect Lighthouse score."
generate_feed = true
compile_sass = true
minify_html = true
Expand All @@ -15,14 +14,98 @@ external_links_target_blank = true
highlight_code = true
highlight_theme = "css"

default_language = "en"

[languages.es]
title = "~/tabi"
description = "tabi es un tema de Zola rápido, liviano y moderno con JavaScript opcional y una puntuación perfecta en Lighthouse."
generate_feed = true
compile_sass = true
minify_html = true

taxonomies = [
{name = "tags", feed = true},
]

[languages.ca]
title = "~/tabi"
description = "tabi és un tema de Zola ràpid, lleuger i modern amb JavaScript opcional i una puntuació perfecta a Lighthouse."
generate_feed = true
compile_sass = true
minify_html = true

taxonomies = [
{name = "tags", feed = true},
]

[languages.es.translations]
language_name = "Español"
date_locale = "es_ES"
# Menu items.
blog = "blog"
archive = "archivo"
tags = "etiquetas"
words = "palabras"
projects = "proyectos"
# Other text.
tags_title = "Todas las etiquetas"
404_error = "La página que has solicitado parece no existir o aún no se ha traducido a tu idioma. Revisa la URL en busca de errores o"
go_home = "regresa a la página de inicio"
read_more = "Leer más"
all_posts = "Todas las entradas"
all_tags = "Todas las etiquetas"
min_read = "min de lectura"
powered_by = "Impulsado por"
and = "y"
post = "entrada"
posts = "entradas"
prev = "Anterior"
next = "Siguiente"
of = "de"
draft = "BORRADOR"
table_of_contents = "Tabla de contenido"
last_updated_on = "Última actualización el"

[languages.ca.translations]
language_name = "Català"
date_locale = "ca_ES"
# Menu items.
blog = "blog"
archive = "arxiu"
tags = "etiquetes"
words = "paraules"
projects = "projectes"
# Other text.
tags_title = "Totes les etiquetes"
404_error = "La pàgina que has sol·licitat sembla que no existeix o encara no s'ha traduït al teu idioma. Comprova l'URL per detectar errors o"
go_home = "torna a la pàgina d'inici"
read_more = "Llegir més"
all_posts = "Totes les entrades"
all_tags = "Totes les etiquetes"
min_read = "min de lectura"
powered_by = "Propulsat per"
and = "i"
post = "entrada"
posts = "entrades"
prev = "Anterior"
next = "Següent"
of = "de"
draft = "ESBORRANY"
table_of_contents = "Taula de contingut"
last_updated_on = "Última actualizació el"

[extra]

language_name.ca = "Català"
language_name.en = "English"
language_name.es = "Español"

# Enable JavaScript theme toggler for dark/light mode (and automatic switching).
# The default setting is the light theme.
theme_switcher = true

# Date format used when listing posts (main page, /blog section, tag posts list…)
# Default is "6th July 2049".
# Default is "6th July 2049" in English and "%d %B %Y" in other languages.
long_date_format = "%d %B %Y"

# Date format used for blog posts.
Expand All @@ -43,10 +126,10 @@ favicon_emoji = "🌱"
headerImage = ""

menu = [
{ name = "blog", url = "$BASE_URL/blog" },
{ name = "archive", url = "$BASE_URL/archive" },
{ name = "tags", url = "$BASE_URL/tags" },
{ name = "projects", url = "$BASE_URL/projects" },
{ name = "blog", url = "blog/" },
{ name = "archive", url = "archive/" },
{ name = "tags", url = "tags/" },
{ name = "projects", url = "projects/" },
]

# The icons available can be found in "social_icons" in the "static" folder
Expand Down
13 changes: 13 additions & 0 deletions content/_index.ca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
+++
path = "/"
title = "Publicacions recents"
sort_by = "date"
template = "section.html"

[extra]
header = {title = "Hola! Soc tabi~", img = "$BASE_URL/img/main.webp" }
section_path = "blog/_index.ca.md"
max_posts = 4
+++

tabi és un tema de [Zola](https://getzola.org) ràpid, lleuger i modern. Té com a objectiu ser una pàgina personal i llar d'entrades de blog. Compta amb una puntuació perfecta de Lighthouse, disseny responsive, tema fosc i clar, shortcodes personalitzats i molt més.
13 changes: 13 additions & 0 deletions content/_index.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
+++
path = "/"
title = "Publicaciones recientes"
sort_by = "date"
template = "section.html"

[extra]
header = {title = "¡Hola! Soy tabi~", img = "$BASE_URL/img/main.webp" }
section_path = "blog/_index.es.md"
max_posts = 4
+++

tabi es un tema de [Zola](https://getzola.org) rápido, ligero y moderno. Su objetivo es ser una página personal y hogar para publicaciones de blogs. Cuenta con una puntuación perfecta en Lighthouse, diseño responsive, tema oscuro y claro, shortcodes personalizados y mucho más.
4 changes: 4 additions & 0 deletions content/archive/_index.ca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+++
title = "Arxiu"
template = "archive.html"
+++
4 changes: 4 additions & 0 deletions content/archive/_index.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
+++
title = "Archivo"
template = "archive.html"
+++
1 change: 0 additions & 1 deletion content/archive/_index.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
+++
title = "Archive"
path = "archive"
template = "archive.html"
+++
8 changes: 8 additions & 0 deletions content/blog/_index.ca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
paginate_by = 5
path = "/blog"
title = "Blog"
sort_by = "date"
template = "section.html"
insert_anchor_links = "left"
+++
8 changes: 8 additions & 0 deletions content/blog/_index.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
+++
paginate_by = 5
path = "/blog"
title = "Blog"
sort_by = "date"
template = "section.html"
insert_anchor_links = "left"
+++
17 changes: 17 additions & 0 deletions content/blog/almost-no-js.ca.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
+++
title = "Gairebé sense JavaScript"
date = 2023-01-06
updated = 2023-04-28
description = "JavaScript només s'utilitza quan HTML i CSS no són suficients."

[taxonomies]
tags = ["funcionalitat"]
+++

# JavaScript?

Aquest tema gairebé no utilitza JavaScript. Inclou uns ~900 bytes de fitxers `.js` amb la lògica per al canvi de tema clar/fosc, que es pot desactivar establint `theme_switcher = false` al fitxer `config.toml`.

La funcionalitat de KaTex, que requereix carregar un fitxer JavaScript de 274 KB, es pot activar per a publicacions específiques.

A part d'això, és un tema ràpid amb HTML i CSS. Tal i com hauria de ser (la major part de) la web :-)
17 changes: 17 additions & 0 deletions content/blog/almost-no-js.es.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
+++
title = "Casi sin JavaScript"
date = 2023-01-06
updated = 2023-04-28
description = "JavaScript solo se utiliza cuando HTML y CSS no son suficientes."

[taxonomies]
tags = ["funcionalidad"]
+++

# ¿JavaScript?

Este tema casi no utiliza JavaScript. Incluye ~900 bytes de código `.js` con la lógica para el interruptor de modo claro/oscuro, el cual puede ser desactivado configurando `theme_switcher = false` en el archivo `config.toml`.

El soporte de KaTeX, que requiere cargar un archivo JavaScript de 274 KB, puede ser activado para publicaciones específicas.

Aparte de esto, es un tema rápido con HTML y CSS. Como debería ser (en su mayoría) la web :-)
Loading