diff options
author | Sean Lane <git@sean.lane.sh> | 2019-01-27 00:27:31 +0300 |
---|---|---|
committer | Sean Lane <git@sean.lane.sh> | 2019-01-27 00:27:31 +0300 |
commit | fe1f269f2443511c849b8a44c9e4e4207eed5873 (patch) | |
tree | 5a21d41a216d62e98881ab0f414ba3ad1e8b7511 | |
parent | 574dc0ab1bfb0ea0b78b5f1fb6c637e3df410c61 (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.html | 14 |
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 --> |