diff options
Diffstat (limited to 'layouts/partials')
-rw-r--r-- | layouts/partials/leading_image.html | 30 | ||||
-rw-r--r-- | layouts/partials/meta_links.html | 10 | ||||
-rw-r--r-- | layouts/partials/metadata.html | 13 | ||||
-rw-r--r-- | layouts/partials/post.html | 1 |
4 files changed, 41 insertions, 13 deletions
diff --git a/layouts/partials/leading_image.html b/layouts/partials/leading_image.html new file mode 100644 index 0000000..ac528d3 --- /dev/null +++ b/layouts/partials/leading_image.html @@ -0,0 +1,30 @@ +{{ $image := "" }} +{{ if (.Resources.ByType "image").GetMatch "*featured*" }} + {{ $image = (.Resources.ByType "image").GetMatch "*featured*" }} +{{ else if resources.Get (index .Params.images 0) }} + {{ $image = resources.Get (index .Params.images 0) }} +{{ end }} +{{ with $image }} + <div class="tc"> + <div class="relative dib"> + <img + src="{{ if ne .MediaType.SubType "svg" }} + {{ $image := .Fit (default "768x400" $.Params.image_size) }} + {{ $image.RelPermalink }} + {{ else }} + {{ $image.RelPermalink }} + {{ end }}" + class="ma0" + alt="{{ .Title }}" + /> + {{ with $.Params.caption }} + <a + href="{{ .url }}" + class="link near-white db absolute bottom-0 right-0 pa2 bg-black-30 br2" + > + {{ .text }} + </a> + {{ end }} + </div> + </div> +{{ end }} diff --git a/layouts/partials/meta_links.html b/layouts/partials/meta_links.html new file mode 100644 index 0000000..00afc71 --- /dev/null +++ b/layouts/partials/meta_links.html @@ -0,0 +1,10 @@ +{{ range $key, $val := .Params.meta_links }} + <a + class="fr f6 link ba br3 ma2 ph2 pv1 dib w3-text-theme w3-hover-theme ttu" + href="{{ . }}" + target="_blank" + rel="noopener" + > + {{ $key }} + </a> +{{ end }} diff --git a/layouts/partials/metadata.html b/layouts/partials/metadata.html index d34c3a8..fdbb504 100644 --- a/layouts/partials/metadata.html +++ b/layouts/partials/metadata.html @@ -1,18 +1,5 @@ {{ $dateTime := .PublishDate.Format "2006-01-02" }} {{ $dateFormat := .Site.Params.dateFormat | default "Jan 2, 2006" }} - -{{ range $key, $val := .Params.meta_links }} - <a - class="fr f6 link ba br3 ma2 ph2 pv1 dib w3-text-theme w3-hover-theme ttu" - href="{{ . }}" - target="_blank" - rel="noopener" - > - {{ $key }} - </a> -{{ end }} - - <p class="f6 lh-copy mv0 ph4 pv2"> By {{ with .Params.author }} diff --git a/layouts/partials/post.html b/layouts/partials/post.html index b84ba92..768755d 100644 --- a/layouts/partials/post.html +++ b/layouts/partials/post.html @@ -1,4 +1,5 @@ <article class="pv4 bt bb b--black-10"> + {{ partial "meta_links.html" . }} <a class="db no-underline dim near-black" href="{{ .RelPermalink }}"> <h3 class="f3 baskerville mt0 lh-title">{{ .Title }}</h3> <div class="cf"> |