feat: add shortcode to resize images

This commit is contained in:
Ungol 2026-01-18 18:41:24 +01:00
parent 7106595bca
commit 0e55353be4
2 changed files with 13 additions and 1 deletions

View file

@ -12,7 +12,6 @@
@use 'parts/page_title';
@use 'parts/table';
*,
*::before,
*::after {
@ -170,3 +169,10 @@ video {
display: block;
border-radius: var(--standard-border-radius);
}
figcaption {
text-align: center;
font-size: .8rem;
color: var(--overlay1);
font-family: var(--text-font);
}

View file

@ -0,0 +1,6 @@
{% set imgpath = page.colocated_path ~ path %}
{% set image = resize_image(path=imgpath, width=width | default(value=300), op="fit_width") %}
<figure>
<img src="{{ image.url }}" alt="{{ alt | default(value='') | safe }}" />
<figcaption>{{ caption | default(value=alt) | safe }}</figcaption>
</figure>