From f2295f37f9e601f17b23e8835c81ed7c713f8cc6 Mon Sep 17 00:00:00 2001
From: Pim van Pelt <pim@ipng.ch>
Date: Sun, 4 Aug 2024 22:43:06 +0200
Subject: [PATCH] Allow for apostrophe ' in image alt tag

---
 content/blog/day7.md                                    | 2 +-
 themes/hugo-theme-notrack/layouts/shortcodes/image.html | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/content/blog/day7.md b/content/blog/day7.md
index 1c951c3..e95755b 100644
--- a/content/blog/day7.md
+++ b/content/blog/day7.md
@@ -121,7 +121,7 @@ lots of bulk packaged things like sweets, candies and booze. It's gonna be fun t
   {{< gallery-photo fn="2024-08-04/IMG_0523.JPG" caption="The baked hamburger buns, golden brown but not crispy -- Marina demands soft buns!" >}}
   {{< gallery-photo fn="2024-08-04/IMG_0524.JPG" caption="Closeup of a hamburger bun with sesame seeds, cut in half to show the breadcrum" >}}
   {{< gallery-photo fn="2024-08-04/IMG_0525.JPG" caption="My burger with salad, cheese, onions and pickles. It was godly." >}}
-  {{< gallery-photo fn="2024-08-04/website.png" caption="A screenshot of the work-in-progress IPng.ch website in Hugo. It is looking really good!" >}}
+  {{< gallery-photo fn="2024-08-04/website.png" caption="A screenshot of the work-in-progress IPng.ch website in Hugo. It's looking really good!" >}}
 {{< /gallery-category >}}
 
 {{< gallery-modal >}}
diff --git a/themes/hugo-theme-notrack/layouts/shortcodes/image.html b/themes/hugo-theme-notrack/layouts/shortcodes/image.html
index 167c319..06a9523 100644
--- a/themes/hugo-theme-notrack/layouts/shortcodes/image.html
+++ b/themes/hugo-theme-notrack/layouts/shortcodes/image.html
@@ -10,7 +10,7 @@
     {{- end }}
     <img src="{{ .Get "src" | relURL }}"
          {{- if or (.Get "alt") (.Get "caption") }}
-         alt="{{ with .Get "alt" }}{{ . }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
+         alt="{{ with .Get "alt" }}{{ replace . "'" "&#39;" }}{{ else }}{{ .Get "caption" | markdownify| plainify }}{{ end }}"
          {{- end -}}
     /> <!-- Closing img tag -->
     {{- if .Get "link" }}</a>{{ end -}}