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 <git@sean.lane.sh>2019-01-27 00:27:31 +0300
committerSean Lane <git@sean.lane.sh>2019-01-27 00:27:31 +0300
commitfe1f269f2443511c849b8a44c9e4e4207eed5873 (patch)
tree5a21d41a216d62e98881ab0f414ba3ad1e8b7511
parent574dc0ab1bfb0ea0b78b5f1fb6c637e3df410c61 (diff)
Changes to recipe template
1. Allow for manually specifying the main image, or choosing just one of Page Resource images as the principle image 2. Remove the center align of the content div
-rw-r--r--layouts/recipes/single.html14
1 files changed, 9 insertions, 5 deletions
diff --git a/layouts/recipes/single.html b/layouts/recipes/single.html
index 94aaf3d..828dd87 100644
--- a/layouts/recipes/single.html
+++ b/layouts/recipes/single.html
@@ -5,12 +5,16 @@
<div class="container" itemscope itemtype="http://schema.org/Recipe">
<!-- call up the image and image credit link -->
- {{ with .Resources.ByType "image" }}
- {{ range . }}
+ {{ with .Params.Image }}
<div class="xs-p2">
- <img itemprop="image" src="{{$.Site.BaseURL}}{{ .RelPermalink }}" />
+ <img itemprop="image" src="{{ . }}" />
</div>
- {{ end }}
+ {{ else }}
+ {{ range first 1 (.Resources.ByType "image") }}
+ <div class="xs-p2">
+ <img itemprop="image" src="{{$.Site.BaseURL}}{{ .RelPermalink }}" />
+ </div>
+ {{ end }}
{{ end }}
<article class="post-content px2">
@@ -20,7 +24,7 @@
</header>
<div class="px2 mt3 clearfix">
- <div class="sm-col-8 center mx-auto" itemprop="description">{{.Content}}</div>
+ <div class="sm-col-8 mx-auto" itemprop="description">{{.Content}}</div>
</div>
<!-- call up recipe and directions -->