From a94bfba03194a8fc9b0714f95353c991508215ff Mon Sep 17 00:00:00 2001 From: liushuyu Date: Sat, 25 Mar 2023 23:43:48 -0600 Subject: [PATCH] layouts: use Hugo to process thumbnails --- layouts/game/single.html | 7 +++---- layouts/screenshots/single.html | 4 +++- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/layouts/game/single.html b/layouts/game/single.html index 648d01e..7455ae7 100644 --- a/layouts/game/single.html +++ b/layouts/game/single.html @@ -3,8 +3,9 @@ {{ $rating := index .Site.Data.compatibility .Params.compatibility }}
- {{ if (fileExists (print "static/images/game/boxart/" .File.BaseFileName ".png")) }} - + {{ $boxart := resources.Get (printf "/images/game/boxart/%s.png" $gameId) }} + {{ if $boxart }} {{ $boxart_thumb := $boxart.Fill "328x300" }} + {{ else }} {{ end }} @@ -187,8 +188,6 @@
{{ $files := readDir (printf "/static/images/screenshots0/%s/" .File.BaseFileName) }} {{ range $index, $element := $files }} - {{ $fileTitle := (index (split .Name "-") 1) }} - {{ $fileTitle := (index (split $fileTitle ".") 0) }}