diff options
Diffstat (limited to 'layouts/partials/pages/title.html')
-rw-r--r-- | layouts/partials/pages/title.html | 26 |
1 files changed, 1 insertions, 25 deletions
diff --git a/layouts/partials/pages/title.html b/layouts/partials/pages/title.html index 16ff432..d2b96e5 100644 --- a/layouts/partials/pages/title.html +++ b/layouts/partials/pages/title.html @@ -10,31 +10,7 @@ {{/* Period */}} {{ if .Params.startDate }} <h3> - {{/* TODO: make partial + rewrite shorter/cleaner */}} - {{ $start := dateFormat .Site.Params.projects.date_format .Params.startDate }} - {{ $period := "" }} - {{ if .Site.Params.projects.period_format }} - {{ if .Params.endDate }} - {{ $end := dateFormat .Site.Params.projects.date_format .Params.endDate }} - {{ $period = replace .Site.Params.projects.period_format "{start}" $start }} - {{ $period = replace $period "{end}" $end }} - {{ else }} - {{ if .Site.Params.projects.period_format_startonly }} - {{ $period = replace .Site.Params.projects.period_format_startonly "{start}" $start }} - {{ else }} - {{ $period = replace .Site.Params.projects.period_format "{start}" $start }} - {{ $period = replace $period "{end}" "..." }} - {{ end }} - {{ end }} - {{ else }} - {{ if .Params.endDate }} - {{ $end := dateFormat .Site.Params.projects.date_format .Params.endDate }} - {{ $period = print "From " $start " to " $end }} - {{ else }} - {{ $period = print "From " $start }} - {{ end }} - {{ end }} - {{ $period }} + {{ partial "time-period.html" (dict "startDate" .Params.startDate "endDate" .Params.endDate) }} {{/* Duration */}} {{ $end := now }} |