From 8b2fba895aa804e895eaa02a622f318113a35663 Mon Sep 17 00:00:00 2001
From: Jacky Zhao <j.zhao2k19@gmail.com>
Date: Thu, 30 Jun 2022 00:34:05 +0000
Subject: [PATCH] feat: image scaling (closes #131)
---
layouts/partials/textprocessing.html | 6 ++----
1 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/layouts/partials/textprocessing.html b/layouts/partials/textprocessing.html
index 56e2e8b..dfb0ff2 100644
--- a/layouts/partials/textprocessing.html
+++ b/layouts/partials/textprocessing.html
@@ -27,10 +27,8 @@
{{$inner := . | strings.TrimPrefix "![[" | strings.TrimSuffix "]]" }}
{{$split := split $inner "|"}}
{{$path := index $split 0 | relURL}}
- {{$reference := split $path "#"}}
- {{$title := index $reference 0}}
- {{$display := default $title (index $split 1)}}
- {{$img := printf "<img src=\"%s\" title=\"%s\">" $path $display}}
+ {{$width := index $split 1}}
+ {{$img := printf "<img src=\"%s\" width=\"%s\" />" $path (default "auto" $width)}}
{{$content = replace $content . $img}}
{{else}}
{{$inner := . | strings.TrimPrefix "[[" | strings.TrimSuffix "]]" }}
--
Gitblit v1.10.0