Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/seanlane/gochowdown.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Lane <5761232+seanlane@users.noreply.github.com>2021-01-03 19:01:22 +0300
committerGitHub <noreply@github.com>2021-01-03 19:01:22 +0300
commitefa38e90b2cb664fbf497a82049b39724e2821c1 (patch)
treebc3954b777245c1a9a570d24c288237b13bdd75c
parenta930bd3ffc1d8b9fdfc0ae7cab44a1d9617679c2 (diff)
parent75eba06d8fffadc75290e2c93a337f59bae1665a (diff)
Merge pull request #11 from Tiliavir/patch-1
Use image defined in front-matter for the recipe in the overview
-rw-r--r--layouts/partials/home.html16
1 files changed, 10 insertions, 6 deletions
diff --git a/layouts/partials/home.html b/layouts/partials/home.html
index d468b7d..35adabd 100644
--- a/layouts/partials/home.html
+++ b/layouts/partials/home.html
@@ -4,12 +4,16 @@
{{ range sort (where .Site.RegularPages "Section" "recipes") "Title" }}
<div class="sm-col sm-col-6 md-col-6 lg-col-4 xs-px1 xs-mb2">
<a class="block relative bg-blue" href="{{ .RelPermalink }}">
- {{ with .Resources.ByType "image" }}
- {{ range first 1 . }}
- <div class="image ratio bg-cover" style="background-image:url({{$.Site.BaseURL}}{{ .RelPermalink }});"></div>
- {{ end }}
+ {{ if .Params.Image }}
+ <div class="image ratio bg-cover" style="background-image:url({{.Permalink}}{{ .Params.Image }});"></div>
{{ else }}
- <div class="image ratio bg-cover"></div>
+ {{ with .Resources.ByType "image" }}
+ {{ range first 1 . }}
+ <div class="image ratio bg-cover" style="background-image:url({{ .Permalink }});"></div>
+ {{ end }}
+ {{ else }}
+ <div class="image ratio bg-cover"></div>
+ {{ end }}
{{ end }}
<h1 class="title p2 m0 absolute white bottom-0 left-0 title-shadow">{{ .Title }}</h1>
</a>
@@ -46,4 +50,4 @@
{{ .Content }}
</div>
</div>
-</div> \ No newline at end of file
+</div>