feat: add gallery shortcode
BIN
content/shortcodes/01-zola.png
Normal file
|
After Width: | Height: | Size: 120 KiB |
BIN
content/shortcodes/02-zola-manet.png
Normal file
|
After Width: | Height: | Size: 324 KiB |
BIN
content/shortcodes/03-zola-cezanne.png
Normal file
|
After Width: | Height: | Size: 357 KiB |
BIN
content/shortcodes/04-gutenberg.jpg
Normal file
|
After Width: | Height: | Size: 47 KiB |
BIN
content/shortcodes/05-example.jpg
Normal file
|
After Width: | Height: | Size: 192 KiB |
BIN
content/shortcodes/06-example.jpg
Normal file
|
After Width: | Height: | Size: 204 KiB |
BIN
content/shortcodes/07-example.jpg
Normal file
|
After Width: | Height: | Size: 42 KiB |
BIN
content/shortcodes/08-example.jpg
Normal file
|
After Width: | Height: | Size: 250 KiB |
|
|
@ -156,3 +156,15 @@ The `example` admonition.
|
|||
{% admonition(type="quote", title="quote") %}
|
||||
The `quote` admonition.
|
||||
{% end %}
|
||||
|
||||
## Gallery
|
||||
|
||||
The `admonition()` shortcode is very simple html-only clickable picture gallery that displays all images from the page assets.
|
||||
|
||||
It's from [Zola documentation](https://www.getzola.org/documentation/content/image-processing/)
|
||||
|
||||
```markdown
|
||||
{{/* gallery() */}}
|
||||
```
|
||||
|
||||
{{ gallery() }}
|
||||
BIN
static/processed_images/01-zola.7c3a26eed1c7ab5f.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
static/processed_images/02-zola-manet.e4241a911597aca7.png
Normal file
|
After Width: | Height: | Size: 78 KiB |
BIN
static/processed_images/03-zola-cezanne.6a107e2be8013406.png
Normal file
|
After Width: | Height: | Size: 94 KiB |
BIN
static/processed_images/04-gutenberg.faa753e9bf9c7908.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/processed_images/05-example.ae15f30d897ab593.jpg
Normal file
|
After Width: | Height: | Size: 12 KiB |
BIN
static/processed_images/06-example.c154d01e3ae79960.jpg
Normal file
|
After Width: | Height: | Size: 18 KiB |
BIN
static/processed_images/07-example.0bae5e2aea7a32b4.jpg
Normal file
|
After Width: | Height: | Size: 4.9 KiB |
BIN
static/processed_images/08-example.5c0108fc0d117d1c.jpg
Normal file
|
After Width: | Height: | Size: 14 KiB |
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>
|
||||