Skip to content

Commit

Permalink
rename to code_block_name_links
Browse files Browse the repository at this point in the history
  • Loading branch information
welpo committed Feb 15, 2025
1 parent 52158d8 commit d728fad
Show file tree
Hide file tree
Showing 14 changed files with 17 additions and 17 deletions.
2 changes: 1 addition & 1 deletion config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,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_block_names = false
code_block_name_links = false

# Force left-to-right (LTR) direction for code blocks.
# Set to false to allow code to follow the document's natural direction.
Expand Down
2 changes: 1 addition & 1 deletion content/blog/javascript/index.ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_block_names = true`. (~400 bytes)
- [**Noms de blocs de codi clicables**](@/blog/shortcodes/index.ca.md#mostrar-ruta-o-url). S'activa configurant `code_block_name_links = 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:
Expand Down
2 changes: 1 addition & 1 deletion content/blog/javascript/index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_block_names = true`. (~400 bytes)
- [**Nombres de bloques de código clicables**](@/blog/shortcodes/index.es.md#mostrar-ruta-o-url). Se activa configurando `code_block_name_links = 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:
Expand Down
2 changes: 1 addition & 1 deletion content/blog/javascript/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -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_block_names = true`. (~300 bytes)
- [**Clickable code block names**](@/blog/shortcodes/index.md#show-source-or-path). Enabled by setting `code_block_name_links = 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:
Expand Down
2 changes: 1 addition & 1 deletion content/blog/mastering-tabi-settings/index.ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ Establir `copy_button = true` afegirà un petit botó de copiar a la part superi
|:------:|:-------:|:-------------:|:---------------:|:-------------------:|
||||||

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.
En establir `code_block_name_links = 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

Expand Down
2 changes: 1 addition & 1 deletion content/blog/mastering-tabi-settings/index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,7 @@ Establecer `copy_button = true` añadirá un pequeño botón de copiar en la par
|:------:|:-------:|:-------------:|:---------------:|:-------------------:|
||||||

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.
Establece `code_block_name_links = 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

Expand Down
2 changes: 1 addition & 1 deletion content/blog/mastering-tabi-settings/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -714,7 +714,7 @@ Setting `copy_button = true` will add a small copy button to the top right of co
|:----:|:-------:|:-------------:|:-----------------:|:-------------------:|
||||||

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.
Setting `code_block_name_links = 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

Expand Down
4 changes: 2 additions & 2 deletions content/blog/shortcodes/index.ca.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags = ["funcionalitat", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_block_names = true
code_block_name_links = true
mermaid = true
social_media_card = "social_cards/ca_blog_shortcodes.jpg"
+++
Expand Down Expand Up @@ -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_block_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 `code_block_name_links = 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__/
Expand Down
4 changes: 2 additions & 2 deletions content/blog/shortcodes/index.es.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags = ["funcionalidad", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_block_names = true
code_block_name_links = true
mermaid = true
social_media_card = "social_cards/es_blog_shortcodes.jpg"
+++
Expand Down Expand Up @@ -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_block_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 `code_block_name_links = 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__/
Expand Down
4 changes: 2 additions & 2 deletions content/blog/shortcodes/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ tags = ["showcase", "shortcodes"]
toc = true
toc_levels = 2
quick_navigation_buttons = true
clickable_code_block_names = true
code_block_name_links = true
mermaid = true
social_media_card = "social_cards/blog_shortcodes.jpg"
+++
Expand Down Expand Up @@ -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_block_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 `code_block_name_links = true` on the `[extra]` section of your page, section, or `config.toml`.") }}

```.gitignore,name=https://github.com/welpo/doteki/blob/main/.gitignore
__pycache__/
Expand Down
File renamed without changes.
File renamed without changes.
6 changes: 3 additions & 3 deletions templates/partials/extra_features.html
Original file line number Diff line number Diff line change
Expand Up @@ -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_block_names". It will be removed in a future release. #}
{# Note: "add_src_to_code_block" is deprecated in favor of "code_block_name_links". 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_block_names", page=page_s, section=section_s, default_global_value=false) == "true"
{%- if macros_settings::evaluate_setting_priority(setting="code_block_name_links", 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/clickableCodeBlockNames.min.js', trailing_slash=false) | safe }}"></script>
<script defer src="{{ get_url(path='js/codeBlockNameLinks.min.js', trailing_slash=false) | safe }}"></script>
{%- endif -%}

{# Add backlinks to footnotes #}
Expand Down
2 changes: 1 addition & 1 deletion theme.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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_block_names = false
code_block_name_links = false

# Force left-to-right (LTR) direction for code blocks.
# Set to false to allow code to follow the document's natural direction.
Expand Down

0 comments on commit d728fad

Please sign in to comment.