Skip to content
Permalink
Browse files

Add featured image to normal page template

  • Loading branch information
Track3 committed Jan 2, 2019
1 parent 1e17ccb commit f601584822fb6cc5877b2a28848e6103a775b35f
Showing with 19 additions and 1 deletion.
  1. +1 −0 archetypes/default.md
  2. +18 −1 layouts/_default/single.html
@@ -3,5 +3,6 @@ title: "{{ replace .Name "-" " " | title }}"
date: {{ .Date }}
draft: true
comments: false
images:
---

@@ -1,8 +1,25 @@
{{ define "head" }}
<style>
.bg-img {background-image: url('
{{- if .Params.featuredImg -}}
{{.Params.featuredImg | absURL}}
{{- else if .Params.images -}}
{{- range first 1 .Params.images -}}
{{. | absURL}}
{{- end -}}
{{- end -}}
');}
</style>
{{ end }}

{{ define "header" }}
{{ partialCached "header.html" . }}
{{ partial "header.html" . }}
{{ end }}

{{ define "main" }}
{{- if (or .Params.images .Params.featuredImg) }}
<div class="bg-img"></div>
{{- end }}
<main class="site-main section-inner thin animated fadeIn faster">
<h1>{{ .Title }}</h1>
<div class="content">

0 comments on commit f601584

Please sign in to comment.
You can’t perform that action at this time.