feat: add shortcode to resize images
This commit is contained in:
parent
7106595bca
commit
0e55353be4
2 changed files with 13 additions and 1 deletions
|
|
@ -12,7 +12,6 @@
|
|||
@use 'parts/page_title';
|
||||
@use 'parts/table';
|
||||
|
||||
|
||||
*,
|
||||
*::before,
|
||||
*::after {
|
||||
|
|
@ -169,4 +168,11 @@ video {
|
|||
margin-right: auto;
|
||||
display: block;
|
||||
border-radius: var(--standard-border-radius);
|
||||
}
|
||||
|
||||
figcaption {
|
||||
text-align: center;
|
||||
font-size: .8rem;
|
||||
color: var(--overlay1);
|
||||
font-family: var(--text-font);
|
||||
}
|
||||
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