mirror of
https://github.com/SebastianStork/kita.git
synced 2026-01-21 13:21:35 +01:00
feat: add inline_svg shortcode
This commit is contained in:
parent
b869da36fb
commit
4bfc2728dc
23 changed files with 198 additions and 115 deletions
10
templates/shortcodes/inline_svg.html
Normal file
10
templates/shortcodes/inline_svg.html
Normal file
|
|
@ -0,0 +1,10 @@
|
|||
{% set img = body | trim_start_matches(pat=" %}<!---->
|
||||
{% set alt = img | first() %}<!---->
|
||||
{% set src = img | last() %}<!---->
|
||||
{% set ignore_names = ["inline svg", "inline-svg", "inline_svg"] %}
|
||||
<figure class="inline-svg">
|
||||
{{ load_data(path="@" ~ page.path ~ src) | safe}}<!---->
|
||||
{% if alt and not ignore_names is containing(alt | lower) %}
|
||||
<figcaption>{{ alt }}</figcaption>
|
||||
{% endif %}
|
||||
</figure>
|
||||
Loading…
Add table
Add a link
Reference in a new issue