From 030cd2457eb4516be2d20aec6741d6001ec405d2 Mon Sep 17 00:00:00 2001 From: quest Date: Mon, 12 Sep 2022 19:37:08 -1000 Subject: [PATCH] Automatically add image height/width in markdown image tags --- layouts/_default/_markup/render-image.html | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 layouts/_default/_markup/render-image.html diff --git a/layouts/_default/_markup/render-image.html b/layouts/_default/_markup/render-image.html new file mode 100644 index 0000000..f3d2043 --- /dev/null +++ b/layouts/_default/_markup/render-image.html @@ -0,0 +1,10 @@ +{{- $img := .Page.Resources.GetMatch .Destination -}} +{{- if and (not $img) .Page.File -}} +{{- $path := path.Join .Page.File.Dir .Destination -}} +{{- $img = resources.Get $path -}} +{{- end -}} +{{- with $img -}} +{{ $.Text }} +{{- else -}} +{{ $.Text }} +{{- end -}} \ No newline at end of file