{{ $base := "art" }} {{ if .Params.threed }} {{ $base = "3d" }} {{ end }} {{ if .Params.animation }} {{ $base = "animation" }} {{ end }} {{ $month := 1 }} {{ $year := 1 }} {{ if .Params.date }} {{ $split := split .Params.date "-" }} {{ $year = int (index $split 0) }} {{ $month = int (index $split 3) }} {{ end }} {{ $use_newformat := false }} {{ if ge (int $year) 2023 }} {{ $use_newformat = true }} {{ end }} {{ if in .File.Dir "art/guest" }} {{ $use_newformat = false }} {{ end }} {{ $full := "" }} {{ $jpeg := "" }} {{ if and $use_newformat (eq $base "art") }} {{ $full = printf "https://images.redstrate.com/thumb/%s.avif" .Params.slug }} {{ $jpeg = printf "https://images.redstrate.com/thumb/%s.jpg" .Params.slug }} {{ else }} {{ $full = resources.Get (printf "%s/%s.webp" $base .Params.slug) }} {{ end }} {{ if $full }} {{ $filename_without_ext := .Params.slug }} {{ $title := .Params.title }} {{ with $full }} {{ if $.Params.threed }} {{ with resources.Get "3d.png" }} {{ end }} {{ end }} {{ if $.Params.comic }} {{ with resources.Get "comic.png" }} {{ end }} {{ end }} {{ if $.Params.animation }} {{ with resources.Get "play-circle.png" }} {{ end }} {{ end }} {{ if and $use_newformat (eq $base "art") }} {{ else }} {{ end }} {{ else }} Thumbnail not found! {{ end }} {{ else }} CANNOT FIND {{ .Params.slug }} {{ $use_newformat }} {{ end }}
Thumbnail not found!