rename to clickable_code_block_names

This commit is contained in:
welpo 2025-02-15 22:13:42 +01:00
parent a65b496e0c
commit 52158d8349
No known key found for this signature in database
GPG key ID: A2F978CF4EC1F5A6
14 changed files with 18 additions and 18 deletions

View file

@ -128,13 +128,13 @@ 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.
# Add a "copy" button to codeblocks (loads ~700 bytes of JavaScript).
# Add a "copy" button to code blocks (loads ~700 bytes of JavaScript).
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
copy_button = true
# Make code block names clickable if they are URLs (loads ~400 bytes of JavaScript).
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
clickable_code_names = false
clickable_code_block_names = false
# Force left-to-right (LTR) direction for code blocks.
# Set to false to allow code to follow the document's natural direction.

View file

@ -28,7 +28,7 @@ Les següents opcions es poden especificar per a publicacions, seccions i global
- [**Suport de KaTeX**](@/blog/markdown/index.ca.md#katex). Habilitat configurant `katex = true` (274 KB). Per renderitzar fórmules sense JS, prova [MathML](https://developer.mozilla.org/docs/Web/MathML/).
- [**Diagrames de Mermaid**](@/blog/shortcodes/index.ca.md#diagrames-de-mermaid). Habilitat configurant `mermaid = true` (~2.5 MB).
- [**Còpia de blocs de codi amb un sol clic**](@/blog/markdown/index.ca.md#bloc-de-codi). Habilitada configurant `copy_button = true`. (~700 bytes)
- [**Noms de blocs de codi clicables**](@/blog/shortcodes/index.ca.md#mostrar-ruta-o-url). S'activa configurant `clickable_code_names = true`. (~400 bytes)
- [**Noms de blocs de codi clicables**](@/blog/shortcodes/index.ca.md#mostrar-ruta-o-url). S'activa configurant `clickable_code_block_names = true`. (~400 bytes)
- [**Filtratge per etiquetes** per a graelles de targetes](@/blog/mastering-tabi-settings/index.ca.md#filtrar-projectes) (p. ex. [projectes](@/projects/_index.ca.md)) (~2KB). S'habilita configurant `enable_cards_tag_filtering = true`.
Per especificar aquestes opcions:

View file

@ -28,7 +28,7 @@ Las siguientes opciones pueden especificarse para publicaciones, secciones y a n
- [**Soporte de KaTeX**](@/blog/markdown/index.es.md#katex). Habilitado al configurar `katex = true` (274 KB). Para renderizar fórmulas sin JS, prueba [MathML](https://developer.mozilla.org/docs/Web/MathML/).
- [**Diagramas de Mermaid**](@/blog/shortcodes/index.es.md#diagramas-de-mermaid). Habilitado al configurar `mermaid = true` (~2.5 MB).
- [**Copia de bloques de código con un solo clic**](@/blog/markdown/index.es.md#bloque-de-codigo). Habilitado al configurar `copy_button = true` (~700 bytes).
- [**Nombres de bloques de código clicables**](@/blog/shortcodes/index.es.md#mostrar-ruta-o-url). Se activa configurando `clickable_code_names = true`. (~400 bytes)
- [**Nombres de bloques de código clicables**](@/blog/shortcodes/index.es.md#mostrar-ruta-o-url). Se activa configurando `clickable_code_block_names = true`. (~400 bytes)
- [**Filtraje por etiquetas** para cuadrículas de tarjetas](@/blog/mastering-tabi-settings/index.es.md#filtrar-proyectos) (p. ej. [proyectos](@/projects/_index.es.md)) (~2KB). Habilitado al configurar `enable_cards_tag_filtering = true`.
Para especificar estas opciones:

View file

@ -28,7 +28,7 @@ The following settings can be specified for posts, sections and globally, follow
- [**KaTeX support**](@/blog/markdown/index.md#katex). Enabled by setting `katex = true` (274 KB). To render math without JS, check out [MathML](https://developer.mozilla.org/docs/Web/MathML/).
- [**Mermaid diagrams**](@/blog/shortcodes/index.md#mermaid-diagrams). Enabled by setting `mermaid = true` (~2.5 MB).
- [**One-click copy of code blocks**](@/blog/markdown/index.md#code-block). Enabled by setting `copy_button = true`. (~700 bytes)
- [**Clickable code block names**](@/blog/shortcodes/index.md#show-source-or-path). Enabled by setting `clickable_code_names = true`. (~300 bytes)
- [**Clickable code block names**](@/blog/shortcodes/index.md#show-source-or-path). Enabled by setting `clickable_code_block_names = true`. (~300 bytes)
- [**Tag filtering** for card grids](@/blog/mastering-tabi-settings/index.md#filtering-projects) (e.g. [projects](@/projects/_index.md)) (~2KB). Enabled by setting `enable_cards_tag_filtering = true`.
To specify these settings:

View file

@ -703,7 +703,7 @@ Establir `copy_button = true` afegirà un petit botó de copiar a la part superi
|:------:|:-------:|:-------------:|:---------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ✅ |
En establir `clickable_code_names = true` s'habiliten els enllaços clicables als noms dels blocs de codi. Consulta la [documentació](@/blog/shortcodes/index.ca.md#mostrar-ruta-o-url) per veure exemples i ús.
En establir `clickable_code_block_names = true` s'habiliten els enllaços clicables als noms dels blocs de codi. Consulta la [documentació](@/blog/shortcodes/index.ca.md#mostrar-ruta-o-url) per veure exemples i ús.
### Forçar blocs de codi d'esquerra a dreta

View file

@ -704,7 +704,7 @@ Establecer `copy_button = true` añadirá un pequeño botón de copiar en la par
|:------:|:-------:|:-------------:|:---------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ✅ |
Establece `clickable_code_names = true` para habilitan los enlaces clickables en los nombres de bloques de código. Consulta la [documentación](@/blog/shortcodes/index.es.md#mostrar-ruta-o-url) para ver ejemplos y uso.
Establece `clickable_code_block_names = true` para habilitan los enlaces clickables en los nombres de bloques de código. Consulta la [documentación](@/blog/shortcodes/index.es.md#mostrar-ruta-o-url) para ver ejemplos y uso.
### Forzar bloques de código de izquierda a derecha

View file

@ -714,7 +714,7 @@ Setting `copy_button = true` will add a small copy button to the top right of co
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
| ✅ | ✅ | ✅ | ✅ | ✅ |
Setting `clickable_code_names = true` enables URLs in code block names to become clickable links. Check out the [documentation](@/blog/shortcodes/index.md#show-source-or-path) for examples and usage.
Setting `clickable_code_block_names = true` enables URLs in code block names to become clickable links. Check out the [documentation](@/blog/shortcodes/index.md#show-source-or-path) for examples and usage.
### Force Code Blocks LTR

View file

@ -11,7 +11,7 @@ tags = ["funcionalitat", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_names = true
clickable_code_block_names = true
mermaid = true
social_media_card = "social_cards/ca_blog_shortcodes.jpg"
+++
@ -213,7 +213,7 @@ fn main() {
Si estableixes el `name` com una URL (és a dir, comença amb `http` o `https`), pots convertir-lo en un enllaç clicable. Això és particularment útil quan s'utilitza juntament amb el [shortcode de text remot](#text-remot).
{{ admonition(type="warning", title="JavaScript necessari", text="La funció d'URLs clicables requereix JavaScript. Per habilitar-la, configura `clickable_code_names = true` a la secció `[extra]` de la teva pàgina, secció, o `config.toml`.") }}
{{ admonition(type="warning", title="JavaScript necessari", text="La funció d'URLs clicables requereix JavaScript. Per habilitar-la, configura `clickable_code_block_names = true` a la secció `[extra]` de la teva pàgina, secció, o `config.toml`.") }}
```.gitignore,name=https://github.com/welpo/doteki/blob/main/.gitignore
__pycache__/

View file

@ -11,7 +11,7 @@ tags = ["funcionalidad", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_names = true
clickable_code_block_names = true
mermaid = true
social_media_card = "social_cards/es_blog_shortcodes.jpg"
+++
@ -212,7 +212,7 @@ fn main() {
Si estableces el `name` como una URL (es decir, comienza con `http` o `https`), puedes convertirlo en un enlace clickable. Esto es particularmente útil cuando se usa junto con el [shortcode de texto remoto](#texto-remoto).
{{ admonition(type="warning", title="JavaScript requerido", text="La función de URLs clickables requiere JavaScript. Para habilitarla, configura `clickable_code_names = true` en la sección `[extra]` de tu página, sección, o `config.toml`.") }}
{{ admonition(type="warning", title="JavaScript requerido", text="La función de URLs clickables requiere JavaScript. Para habilitarla, configura `clickable_code_block_names = true` en la sección `[extra]` de tu página, sección, o `config.toml`.") }}
```.gitignore,name=https://github.com/welpo/doteki/blob/main/.gitignore
__pycache__/

View file

@ -11,7 +11,7 @@ tags = ["showcase", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_names = true
clickable_code_block_names = true
mermaid = true
social_media_card = "social_cards/blog_shortcodes.jpg"
+++
@ -213,7 +213,7 @@ fn main() {
If you set the `name` to a URL (i.e. it starts with `http` or `https`), you can turn it into a clickable link. This is particularly useful when used in conjunction with the [remote text shortcode](#remote-text).
{{ admonition(type="warning", title="JavaScript required", text="The clickable URL feature requires JavaScript. To enable it, set `clickable_code_names = true` on the `[extra]` section of your page, section, or `config.toml`.") }}
{{ admonition(type="warning", title="JavaScript required", text="The clickable URL feature requires JavaScript. To enable it, set `clickable_code_block_names = true` on the `[extra]` section of your page, section, or `config.toml`.") }}
```.gitignore,name=https://github.com/welpo/doteki/blob/main/.gitignore
__pycache__/

View file

@ -63,11 +63,11 @@
{%- endif -%}
{# JavaScript to make code block names clickable when they are URLs: https://welpo.github.io/tabi/blog/shortcodes/#show-source-or-path #}
{# Note: "add_src_to_code_block" is deprecated in favor of "clickable_code_names". It will be removed in a future release. #}
{# Note: "add_src_to_code_block" is deprecated in favor of "clickable_code_block_names". It will be removed in a future release. #}
{# See https://github.com/welpo/tabi/pull/489 #}
{%- if macros_settings::evaluate_setting_priority(setting="clickable_code_names", page=page_s, section=section_s, default_global_value=false) == "true"
{%- if macros_settings::evaluate_setting_priority(setting="clickable_code_block_names", page=page_s, section=section_s, default_global_value=false) == "true"
or macros_settings::evaluate_setting_priority(setting="add_src_to_code_block", page=page_s, section=section_s, default_global_value=false) == "true" -%}
<script defer src="{{ get_url(path='js/clickableCodeNames.min.js', trailing_slash=false) | safe }}"></script>
<script defer src="{{ get_url(path='js/clickableCodeBlockNames.min.js', trailing_slash=false) | safe }}"></script>
{%- endif -%}
{# Add backlinks to footnotes #}

View file

@ -89,7 +89,7 @@ copy_button = true
# Make code block names clickable if they are URLs (loads ~400 bytes of JavaScript).
# Can be set at page or section levels, following the hierarchy: page > section > config. See: https://welpo.github.io/tabi/blog/mastering-tabi-settings/#settings-hierarchy
clickable_code_names = false
clickable_code_block_names = false
# Force left-to-right (LTR) direction for code blocks.
# Set to false to allow code to follow the document's natural direction.