mirror of
https://github.com/yuzu-emu/shared-bulma-theme.git
synced 2024-11-21 22:15:39 +01:00
layouts: use Hugo to process thumbnails
This commit is contained in:
parent
e625f3336e
commit
a94bfba031
@ -3,8 +3,9 @@
|
|||||||
{{ $rating := index .Site.Data.compatibility .Params.compatibility }}
|
{{ $rating := index .Site.Data.compatibility .Params.compatibility }}
|
||||||
<section class="section content pt-sm">
|
<section class="section content pt-sm">
|
||||||
<div class="has-text-centered py-md">
|
<div class="has-text-centered py-md">
|
||||||
{{ if (fileExists (print "static/images/game/boxart/" .File.BaseFileName ".png")) }}
|
{{ $boxart := resources.Get (printf "/images/game/boxart/%s.png" $gameId) }}
|
||||||
<img src="{{ .Site.BaseURL }}/images/game/boxart/{{ .File.BaseFileName }}.png" />
|
{{ if $boxart }} {{ $boxart_thumb := $boxart.Fill "328x300" }}
|
||||||
|
<img src="{{ $boxart_thumb.Permalink }}" />
|
||||||
{{ else }}
|
{{ else }}
|
||||||
<img src="{{ .Site.BaseURL }}/images/boxart.png" />
|
<img src="{{ .Site.BaseURL }}/images/boxart.png" />
|
||||||
{{ end }}
|
{{ end }}
|
||||||
@ -187,8 +188,6 @@
|
|||||||
<div class="tile is-ancestor">
|
<div class="tile is-ancestor">
|
||||||
{{ $files := readDir (printf "/static/images/screenshots0/%s/" .File.BaseFileName) }}
|
{{ $files := readDir (printf "/static/images/screenshots0/%s/" .File.BaseFileName) }}
|
||||||
{{ range $index, $element := $files }}
|
{{ range $index, $element := $files }}
|
||||||
{{ $fileTitle := (index (split .Name "-") 1) }}
|
|
||||||
{{ $fileTitle := (index (split $fileTitle ".") 0) }}
|
|
||||||
<div class="tile is-parent">
|
<div class="tile is-parent">
|
||||||
<div class="tile is-child is-boxed">
|
<div class="tile is-child is-boxed">
|
||||||
<a href="/images/screenshots0/{{ $gameId }}/{{ .Name }}">
|
<a href="/images/screenshots0/{{ $gameId }}/{{ .Name }}">
|
||||||
|
@ -13,7 +13,9 @@
|
|||||||
<div class="tile is-parent">
|
<div class="tile is-parent">
|
||||||
<div class="tile is-child is-boxed">
|
<div class="tile is-child is-boxed">
|
||||||
<a href="/images/screenshots/{{ .Name }}" title="{{ $fileTitle }}">
|
<a href="/images/screenshots/{{ .Name }}" title="{{ $fileTitle }}">
|
||||||
<img src="/images/screenshots/thumbs/{{ .Name }}" alt="{{ $fileTitle }}">
|
{{ $screenshot := resources.Get (printf "/images/screenshots/%s" .Name) }}
|
||||||
|
{{ $thumb := $screenshot.Fit "640x360 jpg" }}
|
||||||
|
<img src="{{ $thumb.Permalink }}" alt="{{ $fileTitle }}">
|
||||||
</a>
|
</a>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user