From 0e55353be4cc7fdfba3f7e6b5436981645f4622d Mon Sep 17 00:00:00 2001 From: Ungol Date: Sun, 18 Jan 2026 18:41:24 +0100 Subject: [PATCH] feat: add shortcode to resize images --- sass/styles.scss | 8 +++++++- templates/shortcodes/resize_local_image.html | 6 ++++++ 2 files changed, 13 insertions(+), 1 deletion(-) create mode 100644 templates/shortcodes/resize_local_image.html diff --git a/sass/styles.scss b/sass/styles.scss index 65769f6..a60f5ea 100644 --- a/sass/styles.scss +++ b/sass/styles.scss @@ -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); } \ No newline at end of file diff --git a/templates/shortcodes/resize_local_image.html b/templates/shortcodes/resize_local_image.html new file mode 100644 index 0000000..4bfaa5d --- /dev/null +++ b/templates/shortcodes/resize_local_image.html @@ -0,0 +1,6 @@ +{% set imgpath = page.colocated_path ~ path %} +{% set image = resize_image(path=imgpath, width=width | default(value=300), op="fit_width") %} +
+ {{ alt | default(value='') | safe }} +
{{ caption | default(value=alt) | safe }}
+
\ No newline at end of file