Use image on home for projects only when project has an image (#288)

* Use image only when project has an image

So if there is no images, then projects can form a bit tigher and more
centered position in a square.

* Use same principle for all projects listing template

As per the review comment the listing of the projects would also be dependent on the existance of the image and creation of the space for it
This commit is contained in:
Crt Mori 2021-03-20 11:55:05 +01:00 committed by GitHub
parent ed759f3228
commit 34761ba2b2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View file

@ -18,6 +18,7 @@
{{ end}}
<div class="column {{ $columWidth }}">
<div class="card" data-target="#project-{{ $index }}">
{{ if .Resources.ByType "image" }}
<div class="card-image">
<figure class="image is-3by2">
<a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}>
@ -30,6 +31,7 @@
</a>
</figure>
</div>
{{ end }}
<div class="card-content has-text-centered top-pad">
<a {{ if .Params.external_link }} href="{{ .Params.external_link }}" {{ end }}>
{{ .Title | markdownify }}

View file

@ -15,6 +15,7 @@
{{ end}}
<div class="column {{ $columWidth }}">
<div class="card">
{{ if .Resources.ByType "image" }}
<div class="card-image">
<figure class="image is-3by2">
<a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}">
@ -27,6 +28,7 @@
</a>
</figure>
</div>
{{ end }}
<div class="card-content has-text-centered top-pad">
<a href="{{ if .Params.external_link }}{{ .Params.external_link }}{{ else }}{{ .Permalink }}{{ end }}">
{{ .Title | markdownify }}