From 988507af98ceb215319cfd4f00f0dda448aea990 Mon Sep 17 00:00:00 2001 From: Jan Kremer Date: Tue, 13 Jan 2026 07:40:34 +0100 Subject: [PATCH] hugo: Display images a figures --- assets/css/main.css | 8 +++----- content/fotos/abendliche-bewoelkung/index.md | 2 +- content/fotos/ustronie-morskie/index.md | 20 +++++++++++++------- hugo.toml | 2 ++ layouts/_markup/render-image.html | 15 +++++++++++++++ 5 files changed, 34 insertions(+), 13 deletions(-) create mode 100644 layouts/_markup/render-image.html diff --git a/assets/css/main.css b/assets/css/main.css index dd1a1d6..8025ab4 100644 --- a/assets/css/main.css +++ b/assets/css/main.css @@ -207,11 +207,9 @@ article { margin: 0; figcaption { - p { - margin: 0.25rem 0 2rem; - font-family: var(--sans-serif); - text-align: center; - } + margin: 0.25rem 0 2rem; + font-family: var(--sans-serif); + text-align: center; } } diff --git a/content/fotos/abendliche-bewoelkung/index.md b/content/fotos/abendliche-bewoelkung/index.md index dfa7f44..bf05433 100644 --- a/content/fotos/abendliche-bewoelkung/index.md +++ b/content/fotos/abendliche-bewoelkung/index.md @@ -5,4 +5,4 @@ description: "über Regensburg" tags: [fotos, regensburg] --- -{{< figure src="abendliche-bewoelkung.webp" alt="Abendliche Bewölkung über Regensburg" caption="Abendliche Bewölkung über Regensburg" loading="lazy" >}} +![Abendliche Bewölkung über Regensburg](./abendliche-bewoelkung.webp "Abendliche Bewölkung über Regensburg") diff --git a/content/fotos/ustronie-morskie/index.md b/content/fotos/ustronie-morskie/index.md index cdae769..f0f6a27 100644 --- a/content/fotos/ustronie-morskie/index.md +++ b/content/fotos/ustronie-morskie/index.md @@ -5,10 +5,16 @@ date: 2025-11-15T21:53:01+01:00 tags: [fotos, polen] --- -{{< figure src="holzwall.jpeg" alt="Holzwall" caption="Holzwall" loading="lazy" decoding="async" fetchpriority="high" >}} -{{< figure src="pfote.jpeg" alt="Pfote" caption="Pfote" loading="lazy" >}} -{{< figure src="nala.jpeg" alt="Nala" caption="Nala" loading="lazy" >}} -{{< figure src="pier.jpeg" alt="Pier" caption="Pier" loading="lazy" >}} -{{< figure src="dom-1.jpeg" alt="Kolberger Dom" caption="Kolberger Dom" loading="lazy" >}} -{{< figure src="dom-2.jpeg" alt="Dom" caption="Dom" loading="lazy" >}} -{{< figure src="moeve.jpeg" alt="Möve" caption="Möve" loading="lazy" >}} +![Holzwall](./holzwall.jpeg "Holzwall") + +![Pfote](./pfote.jpeg "Pfote") + +![Nala](./nala.jpeg "Nala") + +![Pier](./pier.jpeg "Pier") + +![Kolberger Dom](./dom-1.jpeg "Kolberger Dom") + +![Dom](./dom-2.jpeg "Dom") + +![Möve](./moeve.jpeg "Möve") diff --git a/hugo.toml b/hugo.toml index d5b9534..be2d353 100644 --- a/hugo.toml +++ b/hugo.toml @@ -8,6 +8,8 @@ enableGitInfo = true [markup.goldmark] [markup.goldmark.renderer] unsafe = true +[markup.goldmark.parser] +wrapStandAloneImageWithinParagraph = false [markup.highlight] style = "rose-pine-dawn" diff --git a/layouts/_markup/render-image.html b/layouts/_markup/render-image.html new file mode 100644 index 0000000..9b31370 --- /dev/null +++ b/layouts/_markup/render-image.html @@ -0,0 +1,15 @@ +{{- if .IsBlock -}} +
+ + {{- with .Title }}
{{ . }}
{{ end -}} +
+{{- else -}} + +{{- end -}}