{{ $linkToCover := "" }} | |||||
{{ if .Params.featured_image }} | |||||
{{ $linkToCover = .Params.featured_image }} | |||||
{{ else }} | |||||
{{ $img := .Resources.GetMatch "**cover*.jpg" }} | |||||
{{ with $img }} | |||||
{{ $linkToCover = .Permalink }} | |||||
{{ end }} | |||||
{{ end }} | |||||
{{ return $linkToCover }} |
{{ $featured_image := .Params.featured_image }} | |||||
{{ $featured_image := partial "featured.html" . }} | |||||
{{ if $featured_image }} | {{ if $featured_image }} | ||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} | {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} | ||||
{{ $featured_image := (trim $featured_image "/") | absURL }} | {{ $featured_image := (trim $featured_image "/") | absURL }} |
{{ $featured_image := .Params.featured_image }} | |||||
{{ $featured_image := partial "featured.html" . }} | |||||
<article class="bb b--black-10"> | <article class="bb b--black-10"> | ||||
<div class="db pv4 ph3 ph0-l no-underline dark-gray"> | <div class="db pv4 ph3 ph0-l no-underline dark-gray"> | ||||
<div class="flex flex-column flex-row-ns"> | <div class="flex flex-column flex-row-ns"> | ||||
{{ if .Params.featured_image }} | |||||
{{ if $featured_image }} | |||||
{{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} | {{/* Trimming the slash and adding absURL make sure the image works no matter where our site lives */}} | ||||
{{ $featured_image := (trim $featured_image "/") | absURL }} | {{ $featured_image := (trim $featured_image "/") | absURL }} | ||||
<div class="pr3-ns mb4 mb0-ns w-100 w-40-ns"> | <div class="pr3-ns mb4 mb0-ns w-100 w-40-ns"> | ||||
</a> | </a> | ||||
</div> | </div> | ||||
{{ end }} | {{ end }} | ||||
<div class="blah w-100{{ if .Params.featured_image }} w-60-ns pl3-ns{{ end }}"> | |||||
<div class="blah w-100{{ if $featured_image }} w-60-ns pl3-ns{{ end }}"> | |||||
<h1 class="f3 fw1 athelas mt0 lh-title"> | <h1 class="f3 fw1 athelas mt0 lh-title"> | ||||
<a href="{{.Permalink}}" class="color-inherit dim link"> | <a href="{{.Permalink}}" class="color-inherit dim link"> | ||||
{{ .Title }} | {{ .Title }} |
<article class="bb b--black-10"> | <article class="bb b--black-10"> | ||||
<a class="db pv4 ph3 ph0-l no-underline dark-gray dim" href="{{ .Permalink }}"> | <a class="db pv4 ph3 ph0-l no-underline dark-gray dim" href="{{ .Permalink }}"> | ||||
<div class="flex flex-column flex-row-ns"> | <div class="flex flex-column flex-row-ns"> | ||||
{{ if .Params.featured_image }} | |||||
{{ $featured_image := partial "featured.html" . }} | |||||
{{ if $featured_image }} | |||||
<div class="pr3-ns mb4 mb0-ns w-100 w-40-ns"> | <div class="pr3-ns mb4 mb0-ns w-100 w-40-ns"> | ||||
<img src="{{ .Params.featured_image }}" class="db" alt="image from {{ .Title }}"> | |||||
<img src="{{ $featured_image }}" class="db" alt="image from {{ .Title }}"> | |||||
</div> | </div> | ||||
{{ end }} | {{ end }} | ||||
<div class="w-100{{ if .Params.featured_image }} w-60-ns pl3-ns{{ end }}"> | |||||
<div class="w-100{{ if $featured_image }} w-60-ns pl3-ns{{ end }}"> | |||||
<h1 class="f3 fw1 athelas mt0 lh-title">{{ .Title }}</h1> | <h1 class="f3 fw1 athelas mt0 lh-title">{{ .Title }}</h1> | ||||
<div class="f6 f5-l lh-copy nested-copy-line-height"> | <div class="f6 f5-l lh-copy nested-copy-line-height"> | ||||
{{ .Summary }} | {{ .Summary }} |