summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJan Tuomi <jan@jantuomi.fi>2026-08-09 17:32:32 +0300
committerJan Tuomi <jan@jantuomi.fi>2026-08-09 17:32:32 +0300
commit69e01c2a6d0451f9eb7ee67e9ad464e5b1f01a67 (patch)
tree7f67e6eb0cdfc5a1ed854b8bdd6fe345e84afb26
parenteee25cf1d1784e599d35ef55c4642b9cee292f9d (diff)
Fix fig paths in now pages
-rw-r--r--Makefile5
-rw-r--r--content/posts/now-2026-spring/index.md3
-rw-r--r--content/posts/now-2026-summer/index.md3
-rw-r--r--templates_gmi/shortcodes/fig.html7
-rw-r--r--templates_html/shortcodes/fig.html7
5 files changed, 19 insertions, 6 deletions
diff --git a/Makefile b/Makefile
index 7f918e3..9c6a711 100644
--- a/Makefile
+++ b/Makefile
@@ -25,9 +25,10 @@ build: clean
.PHONY: dev
dev:
- @echo "Starting development server..."
+ unlink templates || true
ln -s templates_html templates
- zola serve --drafts
+ @echo "Starting development server..."
+ trap 'unlink templates || true' EXIT; zola serve --drafts
.PHONY: deploy
deploy:
diff --git a/content/posts/now-2026-spring/index.md b/content/posts/now-2026-spring/index.md
index e52a7cc..bea7591 100644
--- a/content/posts/now-2026-spring/index.md
+++ b/content/posts/now-2026-spring/index.md
@@ -2,7 +2,8 @@
title: 🌱 Now, spring 2026
date: 2026-04-12
description: Planning the wedding, reworking my wardrobe. Home reno. Dog escaped.
-kind: now
+extra:
+ kind: now
---
Planning the wedding, reworking my wardrobe. Home reno.
diff --git a/content/posts/now-2026-summer/index.md b/content/posts/now-2026-summer/index.md
index 2ec84df..eab8cf2 100644
--- a/content/posts/now-2026-summer/index.md
+++ b/content/posts/now-2026-summer/index.md
@@ -2,7 +2,8 @@
title: ☀️ Now, summer 2026
date: 2026-06-01
description: TODO
-kind: now
+extra:
+ kind: now
draft: true
---
diff --git a/templates_gmi/shortcodes/fig.html b/templates_gmi/shortcodes/fig.html
index 9988107..4e4b4c3 100644
--- a/templates_gmi/shortcodes/fig.html
+++ b/templates_gmi/shortcodes/fig.html
@@ -1 +1,6 @@
-=> {{ src }} {{ alt }}
+{% if src is starting_with("/") %}
+{% set img_src = src %}
+{% else %}
+{% set img_src = page.path ~ src %}
+{% endif %}
+=> {{ img_src }} {{ alt }}
diff --git a/templates_html/shortcodes/fig.html b/templates_html/shortcodes/fig.html
index 4ac99b4..14b3a5e 100644
--- a/templates_html/shortcodes/fig.html
+++ b/templates_html/shortcodes/fig.html
@@ -1,4 +1,9 @@
+{% if src is starting_with("/") %}
+{% set img_src = src %}
+{% else %}
+{% set img_src = page.path ~ src %}
+{% endif %}
<figure>
- <img src="{{ src }}" alt="{{ alt }}" />
+ <img src="{{ img_src }}" alt="{{ alt }}" />
<figcaption aria-hidden="true">{{ alt }}</figcaption>
</figure>