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:
authorMarkus Lindenmann <Tiliavir@users.noreply.github.com>2020-12-28 15:19:39 +0300
committerGitHub <noreply@github.com>2020-12-28 15:19:39 +0300
commit75eba06d8fffadc75290e2c93a337f59bae1665a (patch)
treed3f638777915dd97ccb80e1898847efe6318a183
parent54b825ad0fd57160ac62fb70b77cb6e8959ebcca (diff)
Take image from front-matter in 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>