From 99f6f2dcdc7bcab449f278fbad8cc4e9350071cd Mon Sep 17 00:00:00 2001 From: welpo Date: Fri, 18 Aug 2023 21:46:37 +0200 Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20feat(footer):=20add=20link=20to=20r?= =?UTF-8?q?emote=20repository?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Adds two options, both defaulting to true if the remote repo URL is set: * `show_remote_changes`: links the commit history of a post next to the updated date. (#109) * `show_remote_source`: links to the site's repository on the footer. --- README.md | 2 +- config.toml | 15 ++++++++++----- templates/macros/content.html | 4 +++- templates/partials/footer.html | 31 ++++++++++++++++++++++++++++++- 4 files changed, 44 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index b783fdefb..a7b22ecb3 100644 --- a/README.md +++ b/README.md @@ -111,7 +111,7 @@ The content outside the front matter will be rendered between the header title a - set the title and taxonomies for each language; - add the `language_name.{code}` in `[extra]`. This is the text shown in the language switcher. -See [these lines in the provided `config.toml`](https://github.com/welpo/tabi/blob/main/config.toml#L22-L132) for an example. +See [these lines in the provided `config.toml`](https://github.com/welpo/tabi/blob/main/config.toml#L22-L134) for an example. You will need an `_index.{language_code}.md` per language for each section (e.g. /blog or /projects) that you want to enable in that language. diff --git a/config.toml b/config.toml index d9745456d..6f2c7abf4 100644 --- a/config.toml +++ b/config.toml @@ -72,6 +72,7 @@ show_original_quote = "Mostrar cita original" show_translation = "Mostrar traducción" load_comments = "Cargar comentarios" see_changes = "Ver cambios" +site_source = "Código del sitio" # Quotation marks for multilingual quote shortcode. open_quotation_mark = "«" close_quotation_mark = "»" @@ -117,6 +118,7 @@ show_original_quote = "Mostra la cita original" show_translation = "Mostra la traducció" load_comments = "Carregar comentaris" see_changes = "Veure canvis" +site_source = "Codi del lloc" # Quotation marks for multilingual quote shortcode. open_quotation_mark = "«" close_quotation_mark = "»" @@ -138,15 +140,18 @@ language_name.en = "English" language_name.es = "Español" # Remote repository for your Zola site. -# Only used to link to the commit history of updated posts, right next to the updated date. +# Used for `show_remote_changes` and `show_remote_source` (see below). # Supports GitHub, GitLab, Gitea, and Codeberg. remote_repository_url = "https://github.com/welpo/tabi" # Set this to "auto" to try and auto-detect the platform based on the repository URL. # Accepted values are "github", "gitlab", "gitea", and "codeberg". -# Defaults to "auto". -remote_repository_git_platform = "auto" -# Branch in the repo hosting the Zola site. Defaults to "main". -remote_repository_branch = "main" +remote_repository_git_platform = "auto" # Defaults to "auto". +# Branch in the repo hosting the Zola site. +remote_repository_branch = "main" # Defaults to "main". +# Show a link to the commit history of updated posts, right next to the last updated date. +show_remote_changes = true # Defaults to true. +# Show a link to the repository of the site, right next to the "Powered by Zola & tabi" text. +show_remote_source = true # Defaults to true. # Enable JavaScript theme toggler to allow users to switch between dark/light mode. # Also enables automatic switching based on user's OS-level theme settings. diff --git a/templates/macros/content.html b/templates/macros/content.html index b32d09fde..9119ea041 100644 --- a/templates/macros/content.html +++ b/templates/macros/content.html @@ -32,7 +32,9 @@ {% if page.updated %}