blob: 7d2f167e3c4c71fa574fde386af12fe3dc94b810 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
|
{{ define "main" }}
<article class="single">
{{ $bkg := "" }}
{{ if gt (len .Params.Images) 0 }}
{{ $bkgImage := print (index .Params.images 0) }}
{{ $bkgURL := printf "%s%s" $.Site.BaseURL $bkgImage }}
{{ $bkg = printf "%s%s%s" "background-image: url('" $bkgURL "');"}}
{{ end }}
<!-- Header -->
<header class="single__header bkg-image" style="{{ safeCSS $bkg }} {{ if $bkg }}height: 75vh; {{end}}">
<h1 class="single__header__title">{{ .Title }}</h1>
{{ if .Params.PublishDate }}
<p class="single__header__date">
{{ if $.Site.Params.date.format }}
{{ .PublishDate.Format $.Site.Params.date.format }}
{{ else }}
{{ .PublishDate.Format "January 2, 2006" }}
{{ end }}
</p>
{{ end }}
{{ if .Params.Author }}
<p class="single__header__author">
By {{ .Params.Author }}
</p>
{{ end }}
{{ if .Params.Description}}
<h2 class="single__header__subtitle">{{ .Description }}</h2>
{{ end}}
</header>
<!-- Content -->
<main class="single__content">
{{ .Content }}
</main>
<!-- Footer -->
<footer class="single__footer">
{{ if .Params.tags }}
{{ if gt (len .Params.tags) 0 }}
{{ .Render "tags" }}
{{ end }}
{{ end }}
</footer>
</article>
{{ end }}
|