feat: add shortcode to resize images
This commit is contained in:
parent
7106595bca
commit
0e55353be4
2 changed files with 13 additions and 1 deletions
6
templates/shortcodes/resize_local_image.html
Normal file
6
templates/shortcodes/resize_local_image.html
Normal 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>
|
||||
Loading…
Add table
Add a link
Reference in a new issue