diff --git a/config.toml b/config.toml index e8a1cda..1b2bd5e 100644 --- a/config.toml +++ b/config.toml @@ -21,7 +21,6 @@ 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 @@ -33,7 +32,6 @@ 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 @@ -74,6 +72,16 @@ load_comments = "Cargar comentarios" # Quotation marks for multilingual quote shortcode. open_quotation_mark = "«" close_quotation_mark = "»" +# Translations for stylised Atom feed. +this_is_a_web_feed = "Esta es una fuente web" +also_known_as_an_Atom_feed = "también conocida como fuente Atom" +subscribe = "Suscríbete" +by_copying_the_URL_from_the_address_bar_into_your_newsreader = "copiando la URL de la barra de direcciones en tu lector de noticias" +visit = "Visita" +to_learn_more_and_get_started = "para aprender más y empezar" +it_s_free = "Es gratis" +website = "la web" +recent_posts = "Publicaciones recientes" [languages.ca.translations] language_name = "Català" @@ -108,6 +116,16 @@ load_comments = "Carregar comentaris" # Quotation marks for multilingual quote shortcode. open_quotation_mark = "«" close_quotation_mark = "»" +# Translations for stylised Atom feed. +this_is_a_web_feed = "Aquest és un canal web" +also_known_as_an_Atom_feed = "també conegut com a canal Atom" +subscribe = "Subscriu-te" +by_copying_the_URL_from_the_address_bar_into_your_newsreader = "copiant l'URL de la barra d'adreces al teu lector de notícies" +visit = "Visita" +to_learn_more_and_get_started = "per aprendre més i començar" +it_s_free = "És gratuït" +website = "la web" +recent_posts = "Publicacions recents" [extra] diff --git a/static/feed_style/en.xsl b/static/feed_style.xsl similarity index 66% rename from static/feed_style/en.xsl rename to static/feed_style.xsl index b6243d9..9bfe6e1 100644 --- a/static/feed_style/en.xsl +++ b/static/feed_style.xsl @@ -1,6 +1,6 @@ + xmlns:atom="http://www.w3.org/2005/Atom" xmlns:base="http://purl.org/atompub/base/1.0/" xmlns:str="https://github.com/welpo/tabi"> @@ -11,15 +11,13 @@ - - - +
- 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. + , . . About Feeds . .
-

Recent Posts

+

diff --git a/static/feed_style/ca.xsl b/static/feed_style/ca.xsl deleted file mode 100644 index 9f2439e..0000000 --- a/static/feed_style/ca.xsl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - <xsl:value-of select="/atom:feed/atom:title"/> • Canal Atom - - - - - - - -
-
-
- 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. -
- - -
-

Publicacions recents

-
-
- -
-
- -
-
- -
- -
- - - - - -
-
-
-
-
-
- - -
-
diff --git a/static/feed_style/es.xsl b/static/feed_style/es.xsl deleted file mode 100644 index 46b4b5a..0000000 --- a/static/feed_style/es.xsl +++ /dev/null @@ -1,71 +0,0 @@ - - - - - - - - <xsl:value-of select="/atom:feed/atom:title"/> • Canal Atom - - - - - - - -
-
-
- 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. -
- - -
-

Publicaciones recientes

-
-
- -
-
- -
-
- -
- -
- - - - - -
-
-
-
-
-
- - -
-
diff --git a/templates/atom.xml b/templates/atom.xml index 91c8efa..cf5a9b2 100644 --- a/templates/atom.xml +++ b/templates/atom.xml @@ -1,9 +1,38 @@ - - - - - {{ config.title }} +<?xml-stylesheet href="{{ get_url(path='/feed_style.xsl', trailing_slash=false) | safe }}" type="text/xsl"?> +<feed xmlns="http://www.w3.org/2005/Atom" xmlns:base="http://purl.org/atompub/base/1.0/" xml:lang="{{ lang }}" xml:base="{{ config.base_url }}"> + {# This section stores the strings/translations for the stylised feed. If the translation is not found, the default English text will be used. #} + <str:translations xmlns:str="https://github.com/welpo/tabi"> + <str:this_is_a_web_feed> + {%- if lang != config.default_language -%} {{ trans(key="this_is_a_web_feed" | safe, lang=lang) }} {%- else -%} This is a web feed {%- endif -%} + </str:this_is_a_web_feed> + <str:also_known_as_an_Atom_feed> + {%- if lang != config.default_language -%} {{ trans(key="also_known_as_an_Atom_feed" | safe, lang=lang) }} {%- else -%} also known as an Atom feed {%- endif -%} + </str:also_known_as_an_Atom_feed> + <str:subscribe> + {%- if lang != config.default_language -%} {{ trans(key="subscribe" | safe, lang=lang) }} {%- else -%} Subscribe {%- endif -%} + </str:subscribe> + <str:by_copying_the_URL_from_the_address_bar_into_your_newsreader> + {%- if lang != config.default_language -%} {{ trans(key="by_copying_the_URL_from_the_address_bar_into_your_newsreader" | safe, lang=lang) }} {%- else -%} by copying the URL from the address bar into your newsreader {%- endif -%} + </str:by_copying_the_URL_from_the_address_bar_into_your_newsreader> + <str:visit> + {%- if lang != config.default_language -%} {{ trans(key="visit" | safe, lang=lang) }} {%- else -%} Visit {%- endif -%} + </str:visit> + <str:to_learn_more_and_get_started> + {%- if lang != config.default_language -%} {{ trans(key="to_learn_more_and_get_started" | safe, lang=lang) }} {%- else -%} to learn more and get started {%- endif -%} + </str:to_learn_more_and_get_started> + <str:it_s_free> + {%- if lang != config.default_language -%} {{ trans(key="it_s_free" | safe, lang=lang) }} {%- else -%} It's free {%- endif -%} + </str:it_s_free> + <str:website> + {%- if lang != config.default_language -%} {{ trans(key="website" | safe, lang=lang) }} {%- else -%} website {%- endif -%} + </str:website> + <str:recent_posts> + {%- if lang != config.default_language -%} {{ trans(key="recent_posts" | safe, lang=lang) }} {%- else -%} Recent posts {%- endif -%} + </str:recent_posts> + </str:translations> + + <title>{{ config.title | striptags | safe }} {%- if term %} - {{ term.name }} {%- elif section.title %} - {{ section.title }} {%- endif -%}