From c448abd99a470e1ec541027077dcdef0745270d8 Mon Sep 17 00:00:00 2001 From: Feuerfuchs Date: Sun, 23 Jun 2019 17:29:07 +0200 Subject: Show expandable thumbnails for images --- template.go | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) (limited to 'template.go') diff --git a/template.go b/template.go index 33486d5..f5f4f2b 100644 --- a/template.go +++ b/template.go @@ -47,7 +47,10 @@ var tpltext = ` {{- $content = printf "%s\n" $content -}} {{- end -}} {{- if .Link -}} - {{- $content = printf "%s%s" $content (printf "%s %s" .Type .Type .Link (.Text | HTMLEscape)) -}} + {{- $content = printf "%s%s" $content (printf "%s %s" .Type .Type .Link (.Text | HTMLEscape)) -}} + {{- if or (eq .Type "IMG") (eq .Type "GIF") -}} + {{- $content = printf "%s\n%s" $content (printf " -> " .Link (.Link | replace "^/(.*?)/I" "/$1/T")) -}} + {{- end -}} {{- else -}} {{- $content = printf "%s%s" $content (printf " %s" (.Text | HTMLEscape)) -}} {{- end -}} @@ -59,16 +62,7 @@ var tpltext = ` ` -- cgit v1.2.3-54-g00ecf