2023-03-30 21:47:18 -04:00
|
|
|
{{ $full := resources.Get (printf "art/%s.webp" .Params.slug) }}
|
|
|
|
{{ 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-10-29 15:20:14 -04:00
|
|
|
<a href="{{ .RelPermalink }}">
|
2023-03-30 21:47:18 -04:00
|
|
|
{{ $path := printf "/art/%d/%.2d/%s" (int $year) (int $month) $filename_without_ext}}
|
|
|
|
{{ $title := .Params.title }}
|
|
|
|
{{ $image := (resources.Get (printf "art/%s.webp" .Params.slug)).Resize "400x bmp" }}
|
|
|
|
|
|
|
|
{{ if .Params.nsfw }}
|
|
|
|
{{ $image = $image | images.Filter (images.GaussianBlur 6) (images.Pixelate 8) }}
|
|
|
|
{{ end }}
|
|
|
|
|
|
|
|
{{ with $image }}
|
2023-10-29 15:20:14 -04:00
|
|
|
<img width="{{ .Width }}" height="{{ .Height }}" alt="{{ $title }}" title="{{ $title }}" src="{{ .RelPermalink }}"/>
|
2023-03-30 21:47:18 -04:00
|
|
|
{{ else }}
|
|
|
|
<p>Thumbnail not found!</p>
|
|
|
|
{{ end }}
|
|
|
|
</a>
|
|
|
|
{{ else }}
|
|
|
|
|
|
|
|
<em>CANNOT FIND {{.Params.slug }}</em>
|
|
|
|
|
|
|
|
{{ end }}
|
|
|
|
|