2023-04-13 11:45:52 -04:00
|
|
|
{{ $base := "art" }}
|
|
|
|
{{ if .Params.threed }}
|
|
|
|
{{ $base = "3d" }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ $full := resources.Get (printf "%s/%s.webp" $base .Params.slug) }}
|
2022-12-28 10:24:59 -05:00
|
|
|
{{ if $full }}
|
|
|
|
|
|
|
|
{{ $filename_without_ext := .Params.slug }}
|
|
|
|
|
|
|
|
{{ $month := 1 }}
|
|
|
|
{{ $year := 1 }}
|
|
|
|
|
|
|
|
{{ if .Params.date }}
|
|
|
|
{{ $split := split .Params.date "-" }}
|
|
|
|
{{ $month = index $split 0 }}
|
|
|
|
{{ $year = index $split 3 }}
|
|
|
|
{{ end }}
|
|
|
|
|
2023-04-03 17:20:42 -04:00
|
|
|
<a class="no-decoration" href="{{ .Permalink }}">
|
2023-04-13 11:45:52 -04:00
|
|
|
|
|
|
|
{{ $path := printf "/%s/%d/%.2d/%s" $base (int $year) (int $month) $filename_without_ext}}
|
2022-12-28 10:24:59 -05:00
|
|
|
{{ $title := .Params.title }}
|
2023-04-13 11:45:52 -04:00
|
|
|
{{ $image := (resources.Get (printf "%s/%s.webp" $base .Params.slug)).Resize "400x" }}
|
2023-02-10 14:25:28 -05:00
|
|
|
|
|
|
|
{{ if .Params.nsfw }}
|
|
|
|
{{ $image = $image | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
|
|
|
|
{{ end }}
|
|
|
|
|
2022-12-28 10:24:59 -05:00
|
|
|
{{ with $image }}
|
2023-03-26 13:47:22 -04:00
|
|
|
<img class="grid-item" width="{{ .Width }}" height="{{ .Height }}" alt="{{ $title }}" title="{{ $title }}" src="{{ .Permalink }}"/>
|
2022-12-28 10:24:59 -05:00
|
|
|
{{ else }}
|
|
|
|
<p>Thumbnail not found!</p>
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
|
|
|
{{ else }}
|
|
|
|
|
2023-04-13 11:45:52 -04:00
|
|
|
<em>CANNOT FIND {{ .Params.slug }}</em>
|
2022-12-28 10:24:59 -05:00
|
|
|
|
|
|
|
{{ end }}
|
2023-04-13 11:45:52 -04:00
|
|
|
|