blob: 1e65a6318840ab6c0a06fdb71cb7dc129a270b2a (
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
|
<hgroup class="title-block">
{{/* Title */}}
<h1>{{ .Title }}</h1>
{{/* Subtitle */}}
{{ with .Params.subtitle }}
<h2>{{ . }}</h2>
{{ end }}
{{/* Period */}}
{{ if .Params.startDate }}
<h3>
From {{ dateFormat .Site.Params.projects.date_format .Params.startDate }}
{{ if .Params.endDate }}
{{ $end := (time .Params.endDate) }}
{{ $duration := $end.Sub (time .Params.startDate) }}
{{ $months := int (div (int (div $duration.Hours 24)) 30.4167) }}
{{ $years := int (div $months 12) }}
{{ $months := int (sub $months (mul $years 12)) }}
to {{ dateFormat .Site.Params.projects.date_format .Params.endDate }}
| {{ if gt $years 0 }}{{ $years }} year{{ if gt $years 1 }}s{{ end }}{{ end }}{{ if and (gt $years 0) (gt $months 0) }}, {{ end }}{{ if gt $months 0 }}{{ $months }} month{{ if gt $months 1 }}s{{ end }}{{ end }}
{{ end }}
</h3>
{{ end }}
</hgroup>
|