bruschetta

A simple golang web based file browser
Log | Files | Refs | LICENSE

commit a00cdf8efa496a76281689fd227c03476e9e968e
parent ff2c8c63e65ddfeef89ecbf71e64e1e933270982
Author: Peter <peter@minskio.co.uk>
Date:   Fri, 23 Oct 2026 13:27:52 +0100

Render svg files as their own thumbnails

Diffstat:
Mmain.go | 6++++--
1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/main.go b/main.go @@ -210,8 +210,10 @@ main{flex:1;overflow-y:auto} <div class="thumb-preview"> {{ if .IsDir }} <span class="big-icon dir-icon">&#128193;</span> - {{ else if isImage .Ext }} - <img src="/__thumb{{ .Path }}" alt="{{ .Name }}" loading="lazy"> + {{ else if eq .Ext "svg" }} + <img src="{{ .Path }}" alt="{{ .Name }}" loading="lazy"> + {{ else if isImage .Ext }} + <img src="/__thumb{{ .Path }}" alt="{{ .Name }}" loading="lazy"> {{ else }} <span class="big-icon">&#128196;</span> {{ end }}