mirror of
https://github.com/gcushen/hugo-academic.git
synced 2025-07-26 19:15:16 +02:00
Add time_format
variable for customizing talk time (#353)
* Add `time_format` variable to `config.toml` * Enables customizing talk time between am/pm or 24h format * Correct Go date format URL in documentation
This commit is contained in:
parent
f3384d45ad
commit
45b2e054e7
4 changed files with 9 additions and 7 deletions
|
@ -69,9 +69,11 @@ defaultContentLanguageInSubdir = false
|
|||
latitude = "37.4275"
|
||||
longitude = "-122.1697"
|
||||
|
||||
# Date format (refer to Go's date format: http://flippinggodateformat.com )
|
||||
# Date and time format (refer to Go's date format: http://fuckinggodateformat.com )
|
||||
# Examples: "Mon, Jan 2, 2006" or "2006-01-02"
|
||||
date_format = "Jan 2, 2006"
|
||||
# Examples: "3:04 pm" or "15:04"
|
||||
time_format = "3:04 PM"
|
||||
|
||||
# Show estimated reading time for posts?
|
||||
reading_time = true
|
||||
|
@ -143,7 +145,7 @@ defaultContentLanguageInSubdir = false
|
|||
|
||||
# Configuration of publication pages.
|
||||
[params.publications]
|
||||
# Date format (refer to Go's date format: http://flippinggodateformat.com )
|
||||
# Date format (refer to Go's date format: http://fuckinggodateformat.com )
|
||||
# Examples: "Mon, Jan 2, 2006" or "2006-01-02"
|
||||
date_format = "January, 2006"
|
||||
|
||||
|
|
|
@ -33,9 +33,9 @@
|
|||
<div class="talk-metadata" itemprop="startDate">
|
||||
{{ $date := .Params.time_start | default .Date }}
|
||||
{{ (time $date).Format $.Site.Params.date_format }}
|
||||
{{ (time $date).Format "3:04 PM" }}
|
||||
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
|
||||
{{ with .Params.time_end }}
|
||||
— {{ (time .).Format "3:04 PM" }}
|
||||
— {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<div itemprop="startDate">
|
||||
{{ $date := .Params.time_start | default .Date }}
|
||||
{{ (time $date).Format $.Site.Params.date_format }}
|
||||
{{ (time $date).Format "3:04 PM" }}
|
||||
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
|
||||
</div>
|
||||
<div class="talk-metadata">
|
||||
{{ if .Params.event_short }}
|
||||
|
|
|
@ -34,9 +34,9 @@
|
|||
{{ $date := .Params.time_start | default .Date }}
|
||||
{{ (time $date).Format $.Site.Params.date_format }}
|
||||
<div class="talk-time">
|
||||
{{ (time $date).Format "3:04 PM" }}
|
||||
{{ (time $date).Format ($.Site.Params.time_format | default "3:04 PM") }}
|
||||
{{ with .Params.time_end }}
|
||||
— {{ (time .).Format "3:04 PM" }}
|
||||
— {{ (time .).Format ($.Site.Params.time_format | default "3:04 PM") }}
|
||||
{{ end }}
|
||||
</div>
|
||||
</div>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue