Add option to hide talk time (#350)

* Add `[params.talks]` section to config
This commit is contained in:
Sandra Parsick 2017-10-26 23:15:54 +02:00 committed by gcushen
commit acbeb3da92
4 changed files with 18 additions and 7 deletions

View file

@ -143,6 +143,11 @@ defaultContentLanguageInSubdir = false
'Book chapter' # 6
]
# Configuration of talk pages.
[params.talks]
# Show talk time?
time = true
# Configuration of publication pages.
[params.publications]
# Date format (refer to Go's date format: http://fuckinggodateformat.com )

View file

@ -33,9 +33,11 @@
<div class="talk-metadata" itemprop="startDate">
{{ $date := .Params.time_start | default .Date }}
{{ (time $date).Format $.Site.Params.date_format }}
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ with .Params.time_end }}
&mdash; {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ if $.Site.Params.talks.time }}
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ with .Params.time_end }}
&mdash; {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ end }}
{{ end }}
</div>

View file

@ -4,7 +4,9 @@
<div itemprop="startDate">
{{ $date := .Params.time_start | default .Date }}
{{ (time $date).Format $.Site.Params.date_format }}
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ if $.Site.Params.talks.time }}
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ end }}
</div>
<div class="talk-metadata">
{{ if .Params.event_short }}

View file

@ -34,9 +34,11 @@
{{ $date := .Params.time_start | default .Date }}
{{ (time $date).Format $.Site.Params.date_format }}
<div class="talk-time">
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ with .Params.time_end }}
&mdash; {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ if $.Site.Params.talks.time }}
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ with .Params.time_end }}
&mdash; {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
{{ end }}
{{ end }}
</div>
</div>