mirror of
https://github.com/SebastianStork/kita.git
synced 2026-01-21 12:11:35 +01:00
feat: add gallery shortcode
This commit is contained in:
parent
67b58641e5
commit
25361cfd7a
18 changed files with 23 additions and 0 deletions
11
templates/shortcodes/gallery.html
Normal file
11
templates/shortcodes/gallery.html
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
<div class="not-prose flex flex-wrap gap-2">
|
||||
{% for asset in page.assets -%}<!---->
|
||||
{% if asset is matching("[.](jpg|png)$") %}<!---->
|
||||
{% set image = resize_image(path=asset, width=240, height=180) %}<!---->
|
||||
{% set asset_name = asset | split(pat="/") | slice(start=-1) | join(sep="/") %}
|
||||
<a href="{{ get_url(path=page.path ~ asset_name) }}" target="_blank">
|
||||
<img class="rounded-lg" src="{{ image.url }}" />
|
||||
</a>
|
||||
{% endif %}<!---->
|
||||
{% endfor %}
|
||||
</div>
|
||||
Loading…
Add table
Add a link
Reference in a new issue