From e7dc5eb44e5c7f6bd00c3d2337438b8481d8101b Mon Sep 17 00:00:00 2001 From: smtbook <40860032+Smtbook@users.noreply.github.com> Date: Mon, 31 Jul 2023 15:36:23 +0800 Subject: [PATCH 1/4] fix: multilingual issues in feeds and 'nav.html' --- static/feed_style/ca.xsl | 71 ++++++++++++++++++++ static/{feed_style.xsl => feed_style/en.xsl} | 2 +- static/feed_style/es.xsl | 71 ++++++++++++++++++++ templates/atom.xml | 2 +- templates/partials/nav.html | 2 +- 5 files changed, 145 insertions(+), 3 deletions(-) create mode 100644 static/feed_style/ca.xsl rename static/{feed_style.xsl => feed_style/en.xsl} (98%) create mode 100644 static/feed_style/es.xsl diff --git a/static/feed_style/ca.xsl b/static/feed_style/ca.xsl new file mode 100644 index 0000000..77955fb --- /dev/null +++ b/static/feed_style/ca.xsl @@ -0,0 +1,71 @@ + + + + + + + + <xsl:value-of select="/atom:feed/atom:title"/> • Feed + + + + + + + +
+
+
+ This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It’s free. +
+ + +
+

Recent Posts

+
+
+ +
+
+ +
+
+ +
+ +
+ + + + + +
+
+
+
+
+
+ + +
+
diff --git a/static/feed_style.xsl b/static/feed_style/en.xsl similarity index 98% rename from static/feed_style.xsl rename to static/feed_style/en.xsl index c47a1ff..ab9c9a0 100644 --- a/static/feed_style.xsl +++ b/static/feed_style/en.xsl @@ -11,7 +11,7 @@ - +
diff --git a/static/feed_style/es.xsl b/static/feed_style/es.xsl new file mode 100644 index 0000000..ec2d89e --- /dev/null +++ b/static/feed_style/es.xsl @@ -0,0 +1,71 @@ + + + + + + + + <xsl:value-of select="/atom:feed/atom:title"/> • Feed + + + + + + + +
+
+
+ This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It’s free. +
+ + +
+

Recent Posts

+
+
+ +
+
+ +
+
+ +
+ +
+ + + + + +
+
+
+
+
+
+ + +
+
diff --git a/templates/atom.xml b/templates/atom.xml index 2e22cd8..0359b48 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -1,5 +1,5 @@ - + {{ config.title }} {%- if term %} - {{ term.name }} diff --git a/templates/partials/nav.html b/templates/partials/nav.html index 10295e7..be1e159 100644 --- a/templates/partials/nav.html +++ b/templates/partials/nav.html @@ -43,7 +43,7 @@ {# Check if the language code matches the default language #} {%- if lcode == config.default_language -%} {# If it does, link to the root path (no language code in URL) #} - <a type="Button" href="{{ current_url | replace(from=current_path | default(value="") | truncate(length=4, end=""), to="/") }}">{{ language_name }}</a> + <a type="Button" href="{{ current_url | replace(from='/' ~ lang ~ '/', to = '/') }}">{{ language_name }}</a> {%- else -%} {# Check if the current language is the default language #} {%- if lang == config.default_language -%} From 588defd7f221e8914ea8c57a66ef7509200302fa Mon Sep 17 00:00:00 2001 From: welpo <welpo@users.noreply.github.com> Date: Mon, 31 Jul 2023 16:57:50 +0200 Subject: [PATCH 2/4] =?UTF-8?q?=F0=9F=93=9D=20docs:=20suggest=20editing=20?= =?UTF-8?q?language=20feed=20stylesheet?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.toml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config.toml b/config.toml index a3cda97..e8a1cda 100644 --- a/config.toml +++ b/config.toml @@ -21,6 +21,7 @@ default_language = "en" 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 +# If you're using feeds, you might want to create/translate the static/feed_style/{lang}.xsl file. compile_sass = true minify_html = true @@ -32,6 +33,7 @@ taxonomies = [ 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 +# If you're using feeds, you might want to create/translate the static/feed_style/{lang}.xsl file. compile_sass = true minify_html = true From f3a0dd7f96dbb8fbd1073f66288133db348917e8 Mon Sep 17 00:00:00 2001 From: welpo <welpo@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:00:24 +0200 Subject: [PATCH 3/4] =?UTF-8?q?=F0=9F=A5=85=20fix:=20load=20English=20styl?= =?UTF-8?q?esheet=20as=20fallback?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- templates/atom.xml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/templates/atom.xml b/templates/atom.xml index 0359b48..91c8efa 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -1,5 +1,7 @@ <?xml version="1.0" encoding="utf-8"?> -<?xml-stylesheet href="/feed_style/{{ lang }}.xsl" type="text/xsl"?> +<!-- Load the default stylesheet (English) first, as fallback. --> +<?xml-stylesheet href="{{ get_url(path='/feed_style/en.xsl', trailing_slash=false) | safe }}" type="text/xsl"?> +<?xml-stylesheet href="{{ get_url(path='/feed_style/' ~ lang ~ '.xsl', trailing_slash=false) | safe }}" type="text/xsl"?> <feed xmlns="http://www.w3.org/2005/Atom" xml:lang="{{ lang }}"> <title>{{ config.title }} {%- if term %} - {{ term.name }} From 7ed295db3aa003595a14a21b6c24c03bdbfeea0f Mon Sep 17 00:00:00 2001 From: welpo <welpo@users.noreply.github.com> Date: Mon, 31 Jul 2023 17:00:44 +0200 Subject: [PATCH 4/4] =?UTF-8?q?=F0=9F=92=AC=20refactor:=20translate=20xsl?= =?UTF-8?q?=20stylesheets?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- static/feed_style/ca.xsl | 8 ++++---- static/feed_style/es.xsl | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/static/feed_style/ca.xsl b/static/feed_style/ca.xsl index 77955fb..3e34693 100644 --- a/static/feed_style/ca.xsl +++ b/static/feed_style/ca.xsl @@ -6,7 +6,7 @@ <html xmlns="http://www.w3.org/1999/xhtml" lang="ca"> <head> <title> - <xsl:value-of select="/atom:feed/atom:title"/> • Feed + <xsl:value-of select="/atom:feed/atom:title"/> • Canal Atom @@ -17,7 +17,7 @@
- This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It’s free. + Aquest és un canal web, també conegut com a canal Atom. Subscriu-te copiant l'URL de la barra d'adreces al teu lector de notícies. Visita Sobre Feeds (en anglès) per aprendre més i començar. És gratuït.
-

Recent Posts

+

Publicacions recents

diff --git a/static/feed_style/es.xsl b/static/feed_style/es.xsl index ec2d89e..def91c0 100644 --- a/static/feed_style/es.xsl +++ b/static/feed_style/es.xsl @@ -6,7 +6,7 @@ - <xsl:value-of select="/atom:feed/atom:title"/> • Feed + <xsl:value-of select="/atom:feed/atom:title"/> • Canal Atom @@ -17,7 +17,7 @@
- This is a web feed, also known as an Atom feed. Subscribe by copying the URL from the address bar into your newsreader. Visit About Feeds to learn more and get started. It’s free. + Esta es una fuente web, también conocida como fuente Atom. Suscríbete copiando la URL de la barra de direcciones en tu lector de noticias. Visita Acerca de Feeds (en inglés) para aprender más y empezar. Es gratis.
-

Recent Posts

+

Publicaciones recientes