mirror of
https://github.com/welpo/tabi.git
synced 2025-10-11 07:46:15 +02:00
✨ feat: enable adding URL/path to code blocks (#307)
This commit is contained in:
parent
0cbd727f25
commit
b70efd1642
17 changed files with 175 additions and 10 deletions
|
@ -1,7 +1,7 @@
|
|||
+++
|
||||
title = "Shortcodes personalitzats"
|
||||
date = 2023-02-19
|
||||
updated = 2024-05-02
|
||||
updated = 2024-05-03
|
||||
description = "Aquest tema inclou alguns shortcodes personalitzats útils que pots utilitzar per millorar les teves publicacions. Ja sigui per mostrar imatges que s'adapten als temes clar i fosc, o per donar format a una secció de referències amb un aspecte professional, aquests shortcodes personalitzats t'ajudaran."
|
||||
|
||||
[taxonomies]
|
||||
|
@ -11,6 +11,7 @@ tags = ["funcionalitat", "shortcodes"]
|
|||
toc = true
|
||||
toc_levels = 2
|
||||
quick_navigation_buttons = true
|
||||
add_src_to_code_block = true
|
||||
social_media_card = "social_cards/ca_blog_shortcodes.jpg"
|
||||
+++
|
||||
|
||||
|
@ -95,6 +96,33 @@ Tots els altres shortcodes d'imatges poden utilizar l'amplada completa assignant
|
|||
{{/* full_width_image(src="img/amsterdam_by_oskerwyld.webp", alt="Fotografia d'un canal a Àmsterdam") */}}
|
||||
```
|
||||
|
||||
## Shortcodes de codi
|
||||
|
||||
### Mostrar ruta o URL
|
||||
|
||||
Mostra una ruta o URL al següent bloc de codi trobat. Si comença amb "http", es convertirà en un enllaç. Particularment útil quan s'utilitza en conjunció amb el [shortcode de text remot](#text-remot).
|
||||
|
||||
{{ admonition(type="warning", title="IMPORTANT", text="Aquesta funcionalitat requereix JavaScript. Per activar-la, configura `add_src_to_code_block = true` a la secció `[extra]` de la teva pàgina, secció, o `config.toml`.") }}
|
||||
|
||||
{{ add_src_to_code_block(src="https://github.com/welpo/doteki/blob/main/.gitignore") }}
|
||||
|
||||
```.gitignore
|
||||
{{ remote_text(src="https://raw.githubusercontent.com/welpo/doteki/main/.gitignore") }}
|
||||
```
|
||||
|
||||
#### Ús
|
||||
|
||||
````
|
||||
{{/* add_src_to_code_block(src="https://github.com/welpo/doteki/blob/main/.gitignore") */}}
|
||||
|
||||
```.gitignore
|
||||
__pycache__/
|
||||
*coverage*
|
||||
.vscode/
|
||||
dist/
|
||||
```
|
||||
````
|
||||
|
||||
## Shortcodes de text
|
||||
|
||||
### Text remot
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue