From f5d32f6032ea172d0f1076b1fa04c96c9205285b Mon Sep 17 00:00:00 2001 From: Jieiku Date: Tue, 26 Sep 2023 18:46:53 -0700 Subject: i18n translation system refactor --- COPY-TO-ROOT-SASS/abridge.scss | 1 + config.toml | 59 +++++++--------------- content/_index.es.md | 5 ++ content/blog/_index.es.md | 5 ++ content/overview-abridge/index.fr.md | 2 +- content/overview-abridge/index.md | 2 +- content/overview-code-blocks.fr.md | 2 +- content/overview-code-blocks.md | 2 +- content/overview-images/index.fr.md | 2 +- content/overview-images/index.md | 2 +- content/overview-markdown-and-style.fr.md | 2 +- content/overview-markdown-and-style.md | 2 +- content/overview-math.fr.md | 2 +- content/overview-math.md | 2 +- content/overview-rich-content/index.fr.md | 2 +- content/overview-rich-content/index.md | 2 +- content/overview-showdata.fr.md | 2 +- content/overview-showdata.md | 2 +- content/video-streaming-sites/_index.es.md | 7 +++ content/video-streaming-sites/_index.fr.md | 7 +++ .../overview-embed-streamable.es.md | 34 +++++++++++++ .../overview-embed-streamable.fr.md | 3 +- .../overview-embed-streamable.md | 3 +- .../overview-embed-vimeo.fr.md | 3 +- .../video-streaming-sites/overview-embed-vimeo.md | 3 +- .../overview-embed-youtube.fr.md | 3 +- .../overview-embed-youtube.md | 3 +- i18n/en.toml | 32 ++++++++++++ i18n/es.toml | 32 ++++++++++++ i18n/fr.toml | 32 ++++++++++++ sass/abridge.scss | 30 +++++------ templates/404.html | 5 +- templates/base.html | 26 ++++++---- templates/categories/list.html | 2 +- templates/index.html | 2 +- templates/macros/macros.html | 41 +++++++++------ templates/page.html | 20 ++++---- templates/tags/list.html | 2 +- 38 files changed, 272 insertions(+), 116 deletions(-) create mode 100644 content/_index.es.md create mode 100644 content/blog/_index.es.md create mode 100644 content/video-streaming-sites/_index.es.md create mode 100644 content/video-streaming-sites/_index.fr.md create mode 100644 content/video-streaming-sites/overview-embed-streamable.es.md create mode 100644 i18n/en.toml create mode 100644 i18n/es.toml create mode 100644 i18n/fr.toml diff --git a/COPY-TO-ROOT-SASS/abridge.scss b/COPY-TO-ROOT-SASS/abridge.scss index 959094f..84cee08 100644 --- a/COPY-TO-ROOT-SASS/abridge.scss +++ b/COPY-TO-ROOT-SASS/abridge.scss @@ -186,6 +186,7 @@ //$top: true,//back to top button using CSS //$search: true,//search feature //$blocks: true,//css classes for block formatting, eg: recent posts, table of contents, series navigation + //$series: true,//series navigation list //$modifiers: true,//tiny modifier classes for sizing, spacing, etc. //$misc: false, //$grid: true,//Infinity Grid, column based layouts. diff --git a/config.toml b/config.toml index aa283a6..a7612d6 100644 --- a/config.toml +++ b/config.toml @@ -45,55 +45,30 @@ title = "Abridge" description = "Abridge est un thème Zola rapide et léger utilisant le html sémantique, le CSS abridge.css class-light et aucun JS obligatoire." generate_feed = true build_search_index = true +search.include_title = true # include title of page/section in index search.include_description = true # include description of page/section in index +search.include_content = true # include rendered content of page/section in index +# search.truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large. taxonomies = [ # {name = "categories", feed = true}, {name = "tags", feed = true}, ] -[languages.fr.translations] -flag = "Français" -date_locale = "fr_FR" -Search = "Recherche" -Recent_Posts = "Articles Récents" -Updated = "Modifié" -Index = "Indice" -Powered_by = "Propulsé" -and = "et" -About = "Sur" -Blog = "Blog" -Posts = "Articles" -Categories = "Catégories" -Tags = "Mots-clés" -Contact = "Contact" -Privacy = "Confidentialité" -Sitemap = "Plan du site" -## Describtion of the number of parts in a series of posts -Series_parts = "Série" # Série de $NUMBER_OF_PARTS parties -### Page not found, maybe moved or not in this language -404_not_found = "Page introuvable, peut-être déplacée ou non dans cette langue" -### Try searching or -404_try_search = "Essayez de rechercher ou" -### go to homepage -404_go_home = "allez à la page d'accueil" -copyright_override = '© $CURRENT_YEAR $SITE_TITLE • Le contenu du site Web est sous licence CC BY 4.0.' - -#[languages.es.translations] -#flag = "Español" +[languages.es] +title = "Abridge" +description = "Abridge es un tema de Zola rápido y liviano que utiliza HTML semántico, CSS ligero de clase abridge.css y JS no obligatorio." +generate_feed = true +build_search_index = true +search.include_title = true # include title of page/section in index +search.include_description = true # include description of page/section in index +search.include_content = true # include rendered content of page/section in index +# search.truncate_content_length = 100 # Truncate at nth character. May be useful if index is getting too large. +taxonomies = [ +# {name = "categories", feed = true}, + {name = "tags", feed = true}, +] [extra] -############################################################################### -### Language -### https://www.w3schools.com/tags/ref_country_codes.asp -### https://tera.netlify.app/docs#date -############################################################################### -date_locale = "en_US" -language_code = "en-US" -flag.en = "English" -flag.fr = "Français" -#flag.es = "Español" - - ############################################################################### ### Layout & Format ### position: top, bottom, both, false(hidden) @@ -119,7 +94,7 @@ toc = true recent = true # TOC / index recent_items = 15 series = true -section_items = 10 # Max amount of section items allowed to displayed in a list, use 0 to disable +series_items = 9 # Max number of items to display in series list #Series_parts = "$NUMBER_OF_PARTS part Series" meta_index = { position="bottom", size="s90", author=false, readtime=false, readstring="min", date=true, updated=false, categories_tags=true, divider="" } diff --git a/content/_index.es.md b/content/_index.es.md new file mode 100644 index 0000000..a31a970 --- /dev/null +++ b/content/_index.es.md @@ -0,0 +1,5 @@ ++++ +paginate_by = 3 +sort_by = "date" +template = "index.html" ++++ diff --git a/content/blog/_index.es.md b/content/blog/_index.es.md new file mode 100644 index 0000000..a31a970 --- /dev/null +++ b/content/blog/_index.es.md @@ -0,0 +1,5 @@ ++++ +paginate_by = 3 +sort_by = "date" +template = "index.html" ++++ diff --git a/content/overview-abridge/index.fr.md b/content/overview-abridge/index.fr.md index d48c680..369b221 100644 --- a/content/overview-abridge/index.fr.md +++ b/content/overview-abridge/index.fr.md @@ -9,7 +9,7 @@ draft = false tags = ["Features","Config"] [extra] toc = true -section = "Features" +series = "Features" +++ Un thème [Zola](https://getzola.org) rapide, léger et moderne utilisant [abridge.css](https://github.com/Jieiku/abridge.css) (un framework HTML CSS sémantique léger en classe ). Scores parfait [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/) et [Observatory](https://observatory.mozilla.org/analyze/abridge.netlify.app). Voici une page [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md). diff --git a/content/overview-abridge/index.md b/content/overview-abridge/index.md index 02c9c16..382696d 100644 --- a/content/overview-abridge/index.md +++ b/content/overview-abridge/index.md @@ -9,7 +9,7 @@ draft = false tags = ["Features","Config"] [extra] toc = true -section = "Features" +series = "Features" +++ A fast, lightweight, and modern [Zola](https://getzola.org) theme utilizing [abridge.css](https://github.com/Jieiku/abridge.css) (a class-light semantic HTML CSS Framework). Perfect [Lighthouse](https://pagespeed.web.dev/report?url=abridge.netlify.app), [YellowLabTools](https://yellowlab.tools/), and [Observatory](https://observatory.mozilla.org/analyze/abridge.netlify.app) scores. Here is a [Zola Themes Benchmarks](https://github.com/Jieiku/zola-themes-benchmarks/blob/main/README.md) Page. diff --git a/content/overview-code-blocks.fr.md b/content/overview-code-blocks.fr.md index 70dc982..c7ec625 100644 --- a/content/overview-code-blocks.fr.md +++ b/content/overview-code-blocks.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Markdown"] [extra] keywords = "Code, Code Blocks, Syntax, Syntax Highlighting, Theme" toc = true -section = "Features" +series = "Features" +++ Cet article présente différents Code Blocks permettant de comparer facilement des thèmes sublimes. diff --git a/content/overview-code-blocks.md b/content/overview-code-blocks.md index 7075354..3265ef0 100644 --- a/content/overview-code-blocks.md +++ b/content/overview-code-blocks.md @@ -9,7 +9,7 @@ tags = ["Features","Markdown"] [extra] keywords = "Code, Code Blocks, Syntax, Syntax Highlighting, Theme" toc = true -section = "Features" +series = "Features" +++ This article shows various Code Blocks allowing to easily compare sublime themes. diff --git a/content/overview-images/index.fr.md b/content/overview-images/index.fr.md index 5b26fa1..ea85994 100644 --- a/content/overview-images/index.fr.md +++ b/content/overview-images/index.fr.md @@ -10,7 +10,7 @@ tags = ["Features","Shortcodes","Images"] keywords = "Image, Markdown, Shortcodes, Swap" thumbnail = "ferris-gesture.png" toc = true -section = "Features" +series = "Features" +++ Cet article couvre les **shortcodes imgswap et img**. Les images peuvent également être intégrées directement à l'aide de markdown `![Ferris](ferris.svg)`, mais il est préférable d'utiliser un shortcode afin de pouvoir définir explicitement la largeur et la hauteur, cela aidera à empêcher le changement de mise en page du contenu, ce qui améliore l'expérience utilisateur et le score Google Lighthouse. diff --git a/content/overview-images/index.md b/content/overview-images/index.md index b5f6e51..d4115be 100644 --- a/content/overview-images/index.md +++ b/content/overview-images/index.md @@ -10,7 +10,7 @@ tags = ["Features","Shortcodes","Images"] keywords = "Image, Markdown, Shortcodes, Swap" thumbnail = "ferris-gesture.png" toc = true -section = "Features" +series = "Features" +++ This post covers the **imgswap and img shortcodes**. Images can also be embedded directly using markdown `![Ferris](ferris.svg)`, but it is better to use a shortcode so you can explicitly set the width and height, this will help prevent content layout shift which improves user experience and the google lighthouse score. diff --git a/content/overview-markdown-and-style.fr.md b/content/overview-markdown-and-style.fr.md index 26c36e9..2c04b25 100644 --- a/content/overview-markdown-and-style.fr.md +++ b/content/overview-markdown-and-style.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Markdown"] [extra] keywords = "Markdown, Style, Syntax, Syntax Highlighting" toc = true -section = "Features" +series = "Features" +++ Cet article propose un exemple de syntaxe Markdown de base pouvant être utilisée dans les fichiers de contenu Zola. Il indique également si les éléments HTML de base sont décorés avec CSS dans un thème Zola. diff --git a/content/overview-markdown-and-style.md b/content/overview-markdown-and-style.md index 210d11c..8b4ee68 100644 --- a/content/overview-markdown-and-style.md +++ b/content/overview-markdown-and-style.md @@ -9,7 +9,7 @@ tags = ["Features","Markdown"] [extra] keywords = "Markdown, Style, Syntax, Syntax Highlighting" toc = true -section = "Features" +series = "Features" +++ This article offers a sample of basic Markdown syntax that can be used in Zola content files, also it shows if basic HTML elements are decorated with CSS in a Zola theme. diff --git a/content/overview-math.fr.md b/content/overview-math.fr.md index 9450be1..5792fb9 100644 --- a/content/overview-math.fr.md +++ b/content/overview-math.fr.md @@ -12,7 +12,7 @@ math = true math_auto_render = true keywords = "Math, Matematics, Notation, KaTeX, Mathematical Notation" toc = true -section = "Features" +series = "Features" +++ Vous pouvez utiliser [KaTeX](https://katex.org) pour rendre des notations mathématiques. diff --git a/content/overview-math.md b/content/overview-math.md index 8dde0c0..d9c35a5 100644 --- a/content/overview-math.md +++ b/content/overview-math.md @@ -12,7 +12,7 @@ math = true math_auto_render = true keywords = "Math, Matematics, Notation, KaTeX, Mathematical Notation" toc = true -section = "Features" +series = "Features" +++ You can use [KaTeX](https://katex.org) to render mathematical notations. diff --git a/content/overview-rich-content/index.fr.md b/content/overview-rich-content/index.fr.md index 3a1e777..2ffd76e 100644 --- a/content/overview-rich-content/index.fr.md +++ b/content/overview-rich-content/index.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Video","Audio","Images","Shortcodes"] [extra] keywords = "Images, Videos, Audio, Gif, Rich Content, Shortcodes" toc = true -section = "Features" +series = "Features" +++ Plusieurs codes abrégés personnalisés sont inclus pour augmenter CommonMark (avec l'aimable autorisation du [theme d3c3nt](https://d3c3nt.figbert.com/posts/rich-content/)). `video`, `image`, `gif`, et `audio` ont été créés pour vous aider à tirer parti des éléments HTML modernes dans votre écriture. diff --git a/content/overview-rich-content/index.md b/content/overview-rich-content/index.md index e923ac4..c42fe98 100644 --- a/content/overview-rich-content/index.md +++ b/content/overview-rich-content/index.md @@ -9,7 +9,7 @@ tags = ["Features","Video","Audio","Images","Shortcodes"] [extra] keywords = "Images, Videos, Audio, Gif, Rich Content, Shortcodes" toc = true -section = "Features" +series = "Features" +++ Several custom shortcodes are included to augment CommonMark (courtesy of [d3c3nt theme](https://d3c3nt.figbert.com/posts/rich-content/)). `video`, `image`, `gif`, and `audio` were created to help you take advantage of modern HTML elements in your writing. diff --git a/content/overview-showdata.fr.md b/content/overview-showdata.fr.md index 2fca9e7..883f9ae 100644 --- a/content/overview-showdata.fr.md +++ b/content/overview-showdata.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Data","Shortcodes"] [extra] keywords = "Data, Load, External, Shortcodes" toc = true -section = "Features" +series = "Features" +++ Le shortcode `showdata` peut charger et afficher des données provenant d'une source externe via la fonction [load_data()](https://www.getzola.org/documentation/templates/overview/#load-data) de Zola. diff --git a/content/overview-showdata.md b/content/overview-showdata.md index 13983fa..827d97f 100644 --- a/content/overview-showdata.md +++ b/content/overview-showdata.md @@ -9,7 +9,7 @@ tags = ["Features","Data","Shortcodes"] [extra] keywords = "Data, Load, External, Shortcodes" toc = true -section = "Features" +series = "Features" +++ The `showdata` shortcode can load and display data from an external source via Zola's [load_data()](https://www.getzola.org/documentation/templates/overview/#load-data) function. diff --git a/content/video-streaming-sites/_index.es.md b/content/video-streaming-sites/_index.es.md new file mode 100644 index 0000000..18f2173 --- /dev/null +++ b/content/video-streaming-sites/_index.es.md @@ -0,0 +1,7 @@ ++++ +render = false +transparent = true +template = "pages.html" ++++ + +Esta es una página sobre códigos cortos para sitios de transmisión de video. diff --git a/content/video-streaming-sites/_index.fr.md b/content/video-streaming-sites/_index.fr.md new file mode 100644 index 0000000..ca9371c --- /dev/null +++ b/content/video-streaming-sites/_index.fr.md @@ -0,0 +1,7 @@ ++++ +render = false +transparent = true +template = "pages.html" ++++ + +Ceci est une page sur les shortcodes pour les sites de streaming vidéo. diff --git a/content/video-streaming-sites/overview-embed-streamable.es.md b/content/video-streaming-sites/overview-embed-streamable.es.md new file mode 100644 index 0000000..0a81f75 --- /dev/null +++ b/content/video-streaming-sites/overview-embed-streamable.es.md @@ -0,0 +1,34 @@ ++++ +title = "Incrustar Streamable" +description = "Artículo de ejemplo que muestra un shortcode personalizado de Zola para incrustar vídeos Streamable en tus páginas." +date = 2021-05-06 +draft = false + +[taxonomies] +tags = ["Features","Shortcodes","Video"] +[extra] +keywords = "Video, Shortcodes, Embed, Embedded, Streamable" +toc = true +series = "Features" ++++ + +Zola tiene muchos shortcodes, y nuevos son facilmente añadidos, este ejemplo muestra streamable. + + +## Streamable + +### Uso + +```rs +{{/* streamable(id="92ok4") */}} +``` + +- `id`: el id del vídeo (obligatorio) +- `class`: una clase para añadir al <div> que rodea al iframe (opcional) +- `title`: establecer el título alt para el iframe (opcional, por defecto "Streamable") + +### Salida +```html +{{ streamable(id="92ok4") }} +``` +{{ streamable(id="92ok4") }} diff --git a/content/video-streaming-sites/overview-embed-streamable.fr.md b/content/video-streaming-sites/overview-embed-streamable.fr.md index f3a3ae9..b6b860b 100644 --- a/content/video-streaming-sites/overview-embed-streamable.fr.md +++ b/content/video-streaming-sites/overview-embed-streamable.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Streamable" toc = true -section = "Features" +series = "Features" +++ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exemple montre streamable. @@ -28,6 +28,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem - `title` - définir le titre alt pour l'iframe (facultatif, par défaut sur "Streamable") ### Output + ```html {{ streamable(id="92ok4") }} ``` diff --git a/content/video-streaming-sites/overview-embed-streamable.md b/content/video-streaming-sites/overview-embed-streamable.md index 69ab797..63181cc 100644 --- a/content/video-streaming-sites/overview-embed-streamable.md +++ b/content/video-streaming-sites/overview-embed-streamable.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Streamable" toc = true -section = "Features" +series = "Features" +++ Zola has many shortcodes, and new are easily added, this example shows streamable. @@ -28,6 +28,7 @@ Zola has many shortcodes, and new are easily added, this example shows streamabl - `title` - set alt title for the iframe (optional, defaults to "Streamable") ### Output + ```html {{ streamable(id="92ok4") }} ``` diff --git a/content/video-streaming-sites/overview-embed-vimeo.fr.md b/content/video-streaming-sites/overview-embed-vimeo.fr.md index 4eab70d..6a7b485 100644 --- a/content/video-streaming-sites/overview-embed-vimeo.fr.md +++ b/content/video-streaming-sites/overview-embed-vimeo.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Vimeo" toc = true -section = "Features" +series = "Features" +++ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exemple montre vimeo. @@ -32,6 +32,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem - `cookie` - défini sur "true" si vous voulez des cookies de suivi, sinon il est par défaut sur false. ### Output + ```html {{ vimeo(id="514402648") }} ``` diff --git a/content/video-streaming-sites/overview-embed-vimeo.md b/content/video-streaming-sites/overview-embed-vimeo.md index 490cac2..23ba088 100644 --- a/content/video-streaming-sites/overview-embed-vimeo.md +++ b/content/video-streaming-sites/overview-embed-vimeo.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Vimeo" toc = true -section = "Features" +series = "Features" +++ Zola has many shortcodes, and new are easily added, this example shows vimeo. @@ -32,6 +32,7 @@ Zola has many shortcodes, and new are easily added, this example shows vimeo. - `cookie` - set to "true" if you want tracking cookies, otherwise it defaults to false. ### Output + ```html {{ vimeo(id="514402648") }} ``` diff --git a/content/video-streaming-sites/overview-embed-youtube.fr.md b/content/video-streaming-sites/overview-embed-youtube.fr.md index 7200a01..913a773 100644 --- a/content/video-streaming-sites/overview-embed-youtube.fr.md +++ b/content/video-streaming-sites/overview-embed-youtube.fr.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Youtube" toc = true -section = "Features" +series = "Features" +++ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exemple montre youtube. @@ -31,6 +31,7 @@ Zola a de nombreux shortcodes, et de nouveaux sont facilement ajoutés, cet exem - `cookie` - défini sur "true" si vous voulez des cookies de suivi, sinon il est par défaut sur false. ### Output + ```html {{ youtube(id="32gyFIWecuw") }} ``` diff --git a/content/video-streaming-sites/overview-embed-youtube.md b/content/video-streaming-sites/overview-embed-youtube.md index b5cc066..fb4f29b 100644 --- a/content/video-streaming-sites/overview-embed-youtube.md +++ b/content/video-streaming-sites/overview-embed-youtube.md @@ -9,7 +9,7 @@ tags = ["Features","Shortcodes","Video"] [extra] keywords = "Video, Shortcodes, Embed, Embedded, Youtube" toc = true -section = "Features" +series = "Features" +++ Zola has many shortcodes, and new are easily added, this example shows youtube. @@ -31,6 +31,7 @@ Zola has many shortcodes, and new are easily added, this example shows youtube. - `cookie` - set to "true" if you want tracking cookies, otherwise it defaults to false. ### Output + ```html {{ youtube(id="32gyFIWecuw") }} ``` diff --git a/i18n/en.toml b/i18n/en.toml new file mode 100644 index 0000000..6065591 --- /dev/null +++ b/i18n/en.toml @@ -0,0 +1,32 @@ +language_name = "English" # Shown in language picker for multi-language sites. +date_locale = "en_US" +full_stop = "." # Used at the end of a sentence. + +# Menu items should match the names in config.extra.menu +Blog = "Blog" +About = "About" +Posts = "Posts" +Tags = "Tags" +Categories = "Categories" +Contact = "Contact" +Privacy = "Privacy" +Sitemap = "Sitemap" + +Search = "Search" +Updated = "Updated" +Index = "Index" +Recent = "Recent" +Powered_by = "Powered by" +and = "&" +more = "more" # "...more" read more links +series_parts = "Series" # $NUMBER_OF_PARTS Part Series : 10 Part Series + +### © $CURRENT_YEAR $SITE_TITLE • Website content is licensed CC BY 4.0. +copyright_override = '© $CURRENT_YEAR $SITE_TITLE • Website content is licensed CC BY 4.0.' + +### Page not found, maybe moved or not in this language +404_not_found = "Page not found, maybe moved or not in this language" +### Try searching or +404_try_search = "Try searching or" +### go to homepage +404_go_home = "go to homepage" diff --git a/i18n/es.toml b/i18n/es.toml new file mode 100644 index 0000000..dd0bee2 --- /dev/null +++ b/i18n/es.toml @@ -0,0 +1,32 @@ +language_name = "Español" # Shown in language picker for multi-language sites. +date_locale = "es_ES" +full_stop = "." # Used at the end of a sentence. + +# Menu items should match the names in config.extra.menu +Blog = "Blog" +About = "Sobre mí" +Posts = "Publicaciones" +Tags = "Etiquetas" +Categories = "Categorías" +Contact = "Contacto" +Privacy = "Privacidad" +Sitemap = "Mapa del sitio" + +Search = "Buscar" +Updated = "Actualizado" +Index = "Índice" +Recent = "Reciente" +Powered_by = "Impulsado por" +and = "y" +more = "más" # "...more" read more links +series_parts = "Serie" # $NUMBER_OF_PARTS Serie de piezas : 10 Part Series + +### © $CURRENT_YEAR $SITE_TITLE • Website content is licensed CC BY 4.0. +copyright_override = '© $CURRENT_YEAR $SITE_TITLE • El contenido del sitio web tiene licencia. CC BY 4.0.' + +### Page not found, maybe moved or not in this language +404_not_found = "Página no encontrada, tal vez movida o no en este idioma" +### Try searching or +404_try_search = "Intente buscar o" +### go to homepage +404_go_home = "ir a la página de inicio" diff --git a/i18n/fr.toml b/i18n/fr.toml new file mode 100644 index 0000000..38d8f08 --- /dev/null +++ b/i18n/fr.toml @@ -0,0 +1,32 @@ +language_name = "Français" # Shown in language picker for multi-language sites. +date_locale = "fr_FR" +full_stop = "." # Used at the end of a sentence. + +# Menu items should match the names in config.extra.menu +Blog = "Blog" +About = "Sur" +Posts = "Articles" +Tags = "Mots-clés" +Categories = "Catégories" +Contact = "Contact" +Privacy = "Confidentialité" +Sitemap = "Plan du site" + +Search = "Recherche" +Updated = "Modifié" +Index = "Indice" +Recent = "Récent" +Powered_by = "Propulsé" +and = "et" +more = "plus" # "...more" read more links +series_parts = "Série" # Série de $NUMBER_OF_PARTS parties : 10 Part Series + +### © $CURRENT_YEAR $SITE_TITLE • Website content is licensed CC BY 4.0. +copyright_override = '© $CURRENT_YEAR $SITE_TITLE • Le contenu du site Web est sous licence CC BY 4.0.' + +### Page not found, maybe moved or not in this language +404_not_found = "Page introuvable, peut-être déplacée ou non dans cette langue" +### Try searching or +404_try_search = "Essayez de rechercher ou" +### go to homepage +404_go_home = "allez à la page d'accueil" diff --git a/sass/abridge.scss b/sass/abridge.scss index cf6960a..9f008de 100644 --- a/sass/abridge.scss +++ b/sass/abridge.scss @@ -215,6 +215,7 @@ $form: true !default;//Form elements (non-button) $top: true !default;//back to top button using CSS $search: true !default;//search feature $blocks: true !default;//css classes for block formatting, eg: recent posts, table of contents, series navigation +$series: true !default;//series navigation list $modifiers: true !default;//tiny modifier classes for sizing and spacing $imgswap: true !default;//Image Swap on hover/click $misc: false !default; @@ -1182,21 +1183,6 @@ $syntax: true !default;//syntax highlighting for code blocks max-width: 30rem; margin: var(--s2) auto; } - - // Hides the next .hidden_li element when details is closed - details:not([open]) + .hidden_li { - height: 0; - visibility: hidden; - overflow: hidden; - } - - summary { - margin-left: -1em; - margin-bottom: .2rem; - color: var(--c4); - } - - .blockdiv { border-radius: var(--br); border-top: 5px solid var(--a1); @@ -1216,6 +1202,18 @@ $syntax: true !default;//syntax highlighting for code blocks } } .sblock { + @if $series { + details:not([open]) + .hidden_li {// Series: Hides next .hidden_li element when details is closed + height: 0; + visibility: hidden; + overflow: hidden; + } + summary {// Series: aligns item with the rest of the list, and color differently. + margin-left: -1em; + margin-bottom: .2rem; + color: var(--c4); + } + } ol,ul { font-size: 1em; } @@ -1590,4 +1588,4 @@ $syntax: true !default;//syntax highlighting for code blocks //.z-variable.z-language.z-fenced.z-markdown { // color: var(--h1); //} -} \ No newline at end of file +} diff --git a/templates/404.html b/templates/404.html index 07f32b3..fee5607 100644 --- a/templates/404.html +++ b/templates/404.html @@ -26,7 +26,10 @@ {# Iterate through each language and display the localised 404 message #} {%- for lcode, language in config.languages -%} {%- if lcode != config.default_language -%} -

{{ trans(key="404_not_found", lang=lcode) }}. {% if config.build_search_index %}{{ trans(key="404_try_search", lang=lcode) }}{% endif %} {{ trans(key="404_go_home", lang=lcode) }}.

+ {%- set i18n_404 = load_data(path="i18n/" ~ lcode ~ '.toml', required=false) -%} + {%- if not i18n_404 -%}{%- set i18n_404 = load_data(path="themes/abridge/i18n/" ~ lcode ~ ".toml", required=false) -%}{%- endif %} + +

{{ macros::translate(key="404_not_found", default="404_not_found", i18n=i18n_404) }}{{ macros::translate(key="full_stop", default=".", i18n=i18n_404) }} {% if config.build_search_index %}{{ macros::translate(key="404_try_search", default="Try searching or", i18n=i18n_404) }}{% endif %} {{ macros::translate(key="404_go_home", default="go to homepage", i18n=i18n_404) }}{{ macros::translate(key="full_stop", default=".", i18n=i18n_404) }}

{%- endif -%} {%- endfor -%} diff --git a/templates/base.html b/templates/base.html index b1172a9..72a5204 100644 --- a/templates/base.html +++ b/templates/base.html @@ -1,5 +1,9 @@ {%- import 'macros/seo.html' as macros_seo %} {%- import "macros/macros.html" as macros %} +{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} +{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} +{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} + {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -52,7 +56,7 @@ {%- if config.extra.menu %} {%- for i in config.extra.menu -%}
  • - {%- if lang != config.default_language %} {{ trans(key=i.name | safe, lang=lang) }} {% else %} {{ i.name | safe }} {% endif -%} + {%- if lang != config.default_language %} {{ macros::translate(key=i.name|safe, default=i.name|safe, i18n=i18n) }} {% else %} {{ i.name | safe }} {% endif -%}
  • {%- endfor -%} {%- endif -%} @@ -61,13 +65,17 @@
  • {{ inner.title }}
  • + {% else %} +
  • {{ inner.title }}
  • + {%- endif %} +{%- endmacro %} + {%- macro title_post(page, config) %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} @@ -17,6 +30,10 @@ {%- macro meta_post(page, config) %} +{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} +{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} +{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} + {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -55,7 +72,7 @@ {%- if config.extra.meta_post.date %} {%- if config.extra.icon_date %} {% endif %} {%- if config.extra.date_locale %} {%- if lang != config.default_language -%} - {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} {%- else -%} {%- set lang_locale = config.extra.date_locale -%} {%- endif -%} @@ -67,10 +84,10 @@ {#- Updated #} {%- if config.extra.meta_post.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} - {%- if lang != config.default_language %} {{ trans(key="Updated" | safe, lang=lang) }}{% else %} Updated{% endif %}: + {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}: {%- if config.extra.date_locale %} {%- if lang != config.default_language -%} - {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} {%- else -%} {%- set lang_locale = config.extra.date_locale -%} {%- endif %} {{ page.updated | date(format="%B %d, %Y", locale=lang_locale) }} @@ -97,6 +114,9 @@ {%- macro meta_index(page, config) %} +{# Load current language i18n data from .toml files in user's '/i18n' folder, use theme as fallback. #} +{%- set i18n = load_data(path="i18n/" ~ lang ~ '.toml', required=false) -%} +{%- if not i18n -%}{%- set i18n = load_data(path="themes/abridge/i18n/" ~ lang ~ ".toml", required=false) -%}{%- endif %} {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} {%- if config.extra.offline %}{% set uglyurls = true %}{% endif %} @@ -135,7 +155,7 @@ {%- if config.extra.meta_index.date %} {%- if config.extra.icon_date %} {% endif %} {%- if config.extra.date_locale %} {%- if lang != config.default_language -%} - {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} {%- else -%} {%- set lang_locale = config.extra.date_locale -%} {%- endif -%} @@ -147,10 +167,10 @@ {#- Updated #} {%- if config.extra.meta_index.updated and page.updated %} {%- if config.extra.icon_date %} {% endif -%} - {%- if lang != config.default_language %} {{ trans(key="Updated" | safe, lang=lang) }}{% else %} Updated{% endif %}: + {{ macros::translate(key="Updated", default="Updated", i18n=i18n) }}: {%- if config.extra.date_locale %} {%- if lang != config.default_language -%} - {%- set lang_locale = trans(key="date_locale" | safe, lang=lang) -%} + {%- set lang_locale = macros::translate(key='date_locale', default='en_US', i18n=i18n) -%} {%- else -%} {%- set lang_locale = config.extra.date_locale -%} {%- endif %} {{ page.updated | date(format="%B %d, %Y", locale=lang_locale) }} @@ -297,12 +317,3 @@ {%- endif %} {%- endmacro %} - -{%- macro series_link(inner, page) %} - {%- set uglyurls = config.extra.uglyurls | default(value=false) -%} - {%- if inner.content == page.content %} -
  • {{ inner.title }}
  • - {% else %} -
  • {{ inner.title }}
  • - {%- endif %} -{%- endmacro %} \ No newline at end of file diff --git a/templates/page.html b/templates/page.html index d7abe0b..f5ca311 100644 --- a/templates/page.html +++ b/templates/page.html @@ -47,13 +47,13 @@ {# In Page Series Navigation #} {%- if config.extra.series | default(value=true) %} - {%- if page.extra.section %} + {%- if page.extra.series %} - {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.section, lang=lang) %} + {%- set tag = get_taxonomy_term(kind="tags", term=page.extra.series, lang=lang) %} {%- set page_num = tag.page_count | as_str %} {%- if lang != config.default_language %} - {%- set parts_string = trans(key="Series_parts", lang=lang) | replace(from="$NUMBER_OF_PARTS", to=page_num) %} + {%- set parts_string = macros::translate(key='Series_parts', default='Series', i18n=i18n) | replace(from="$NUMBER_OF_PARTS", to=page_num) %} {% else %} {%- set parts_string = config.extra.Series_parts | default(value="Series") | replace(from="$NUMBER_OF_PARTS", to=page_num) %} {% endif -%} @@ -102,15 +102,15 @@ {%- if toc %}
    - {%- if page.extra.section %} - {%- set num_extra_pages = config.extra.section_items | default(value=5) %} + {%- if page.extra.series %} + {%- set num_extra_pages = config.extra.series_items | default(value=9) %}
    {{ parts_string }}
      {%- if tag.page_count > num_extra_pages and num_extra_pages > 0 %} - {%- set sorted_array = tag.pages | sort(attribute="date") %} + {%- set sorted_array = tag.pages | sort(attribute="date") %} {%- set num_pages = tag.page_count %} - + {# Shows the first page #} {{ macros::series_link(inner=sorted_array.0, page=page) }} @@ -132,7 +132,7 @@ {%- else %} {%- set num = 1 %} {%- endif %} - + {# Shows two pages before current page #} {%- for inner in sorted_array | slice(start=num, end=current_section_index) %}
    1. {{ inner.title }}
    2. @@ -164,7 +164,7 @@ {%- endfor %}
    {%- endif %} - + {%- set last = num_pages - 1%} {{ macros::series_link(inner=sorted_array[last], page=page) }} @@ -179,7 +179,7 @@ {%- endif %}
    - {%- if lang != config.default_language %}{{ trans(key="Index" | safe, lang=lang) }}{% else %}Index{% endif %} + {{ macros::translate(key="Index", default="Index", i18n=i18n) }} {%- for h in toc %}
    {{ h.title }} diff --git a/templates/tags/list.html b/templates/tags/list.html index 4f53a58..8ed7b5c 100644 --- a/templates/tags/list.html +++ b/templates/tags/list.html @@ -20,7 +20,7 @@ {%- block content %}
    -

    {{ terms | length }} {%- if lang != config.default_language %} {{ trans(key="Tags" | safe, lang=lang) }} {% else %} Tags {% endif %}

    +

    {{ terms | length }} {{ macros::translate(key="Tags", default="Tags", i18n=i18n) }}

    {% for term in terms %} #{{ term.name }}{{ term.pages | length }} {% endfor %}

    {%- for term in terms %} -- cgit v1.3.1