fix: moved default image to theme

This commit is contained in:
Wivik 2023-08-20 00:17:23 +02:00
parent 9232bacdf2
commit f1d584a2bb
No known key found for this signature in database
GPG Key ID: 4C47CF1D8592D50F
3 changed files with 4 additions and 2 deletions

BIN
assets/img/default.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 87 KiB

View File

@ -8,7 +8,8 @@
<main class="album-list">
{{ range .Pages }}
<section class="album-card" style="background-image: url('{{ .Site.BaseURL }}/{{ if .Params.cover }}{{ .Params.cover }}{{ else }}default.png{{ end }}')">
{{ $default_img := resources.Get "img/default.png" }}
<section class="album-card" style="background-image: url('{{ if .Params.cover }}{{ .Site.BaseURL }}/{{ .Params.cover }}{{ else }}{{ $default_img.Permalink }}{{ end }}')">
{{ if .Params.band }}
<a href="/band/{{ .Params.band | urlize }}" class="album-band">{{ .Params.band }}</a>
{{ end }}

View File

@ -21,7 +21,8 @@
{{ if .Params.cover }}
<a href="/{{ .Params.cover | urlize }}">
{{ end }}
<img src="/{{ if .Params.cover }}{{ .Params.cover }}{{ else }}default.png{{ end }}" alt="{{ .Title }}" title="{{ .Title }}" />
{{ $default_img := resources.Get "img/default.png" }}
<img src="{{ if .Params.cover }}{{ .Site.BaseURL }}/{{ .Params.cover }}{{ else }}{{ $default_img.Permalink }}{{ end }}" alt="{{ .Title }}" title="{{ .Title }}" />
{{ if .Params.cover }}
</a>
{{ end }}