diff options
author | Kevin Hamer <kevin@imarc.com> | 2020-10-11 17:28:37 -0400 |
---|---|---|
committer | Mantas Vilčinskas <hi@mnts.lt> | 2020-10-27 21:38:46 +0200 |
commit | f5e7f886e79241f002cf28a1c8018d81fbd2ee57 (patch) | |
tree | a30a91049bfac2893e535b641d9c0c4b6afd08c2 | |
parent | 656f716ecb87ac563e1566592472a65db7019409 (diff) |
add .Site.Params.useRelativeTime
-rw-r--r-- | exampleSite/config.yml | 9 | ||||
-rw-r--r-- | layouts/issues/small.html | 6 |
2 files changed, 10 insertions, 5 deletions
diff --git a/exampleSite/config.yml b/exampleSite/config.yml index 85665f6..967505f 100644 --- a/exampleSite/config.yml +++ b/exampleSite/config.yml @@ -124,7 +124,7 @@ params: - name: North Coast description: The main servers are located here. closed: true - - name: East Coast + - name: East Coast - name: Uncategorized untitled: true @@ -157,6 +157,11 @@ params: dateFormat: January 2, 2006 at 3:04 PM shortDateFormat: 15:04 — Jan 2 + # If enabled, will display relative times for incident history and summaries instead of using dateFormat. + # + # Default: true + useRelativeTime: true + # What header design should we use? # # Default: true @@ -277,7 +282,7 @@ params: # Default: `true` # BOOLEAN; `true`, `false` alwaysKeepBrandColor: true - + # Introduced in v4.0.1 for consistent # site title text color. # diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 6112e46..79db524 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -8,7 +8,7 @@ <a href="{{ .Permalink }}" class="issue no-underline"> {{ if .Params.informational }} - <small class="date float-right relative-time" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -23,7 +23,7 @@ </span> {{ else if .Params.Resolved }} - <small class="date float-right relative-time" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} @@ -67,7 +67,7 @@ {{ end }} {{ else }} - <small class="date float-right relative-time" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> + <small class="date float-right {{ cond .Site.Params.useRelativeTime "relative-time" "" }}" title="{{ .Date.Format "02 Jan 2006 03:05:00 PM" }}"> {{ if .Site.Params.dateFormat }} {{ .Date.Format .Site.Params.dateFormat }} {{ else }} |