From 5877449148d7e4aceeb6e2a809a78c90f61385c8 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:04:01 +0200 Subject: use dateFormat instead of .Date.Format --- layouts/issues/single.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/issues/single.html b/layouts/issues/single.html index 0dd8052..9aa135b 100644 --- a/layouts/issues/single.html +++ b/layouts/issues/single.html @@ -21,7 +21,7 @@

{{ T "lastChecked" }}: {{ if .Site.Params.dateFormat }} - {{ .Lastmod.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Lastmod }} {{ else }} {{ .Lastmod.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 9d0a4a7124589aa2cf9ed9c586d03ec1bf5406c7 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:04:40 +0200 Subject: use dateFormat instead of .Date.Format for better localization --- layouts/issues/issue.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/issues/issue.html b/layouts/issues/issue.html index 71bb30a..b7ec2ce 100644 --- a/layouts/issues/issue.html +++ b/layouts/issues/issue.html @@ -12,7 +12,7 @@ {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From fea94cf3390954ad25cc12104991193adddb2632 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:09:54 +0200 Subject: use dateFormat instead of .Date.Format for better localization --- layouts/issues/small.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'layouts') diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 5eb3a2d..9c21cfb 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -10,7 +10,7 @@ {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} @@ -25,7 +25,7 @@ {{ else if .Params.Resolved }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 510dbe065b267d49e64666b810b6d148ae26c41f Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:36:34 +0200 Subject: added Dateformat localization to `relative-time` `relative-time` didn't respected the dateformat, but defaultet on UTC. The Title-Attribute (hover) now displays time in the chosen dateformat. an additional Attribut `data-date` contains the UTC-Format for calculating the relative times using JavaScript --- layouts/issues/small.html | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'layouts') diff --git a/layouts/issues/small.html b/layouts/issues/small.html index 9c21cfb..94fede3 100644 --- a/layouts/issues/small.html +++ b/layouts/issues/small.html @@ -8,7 +8,7 @@ {{ if .Params.informational }} - + {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} @@ -23,7 +23,7 @@ {{ else if .Params.Resolved }} - + {{ if .Site.Params.dateFormat }} {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} @@ -68,11 +68,11 @@ {{ else }} - + {{ if .Date.Before now }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} @@ -94,7 +94,7 @@ {{ T "downtimeOngoing" }} {{ else }} {{ if .Site.Params.dateFormat }} - {{ .Date.Format .Site.Params.dateFormat }} + {{ dateFormat .Site.Params.dateFormat .Params.date }} {{ else }} {{ .Date.Format "January 2, 2006 at 3:04 PM" }} {{ end }} -- cgit v1.2.3-70-g09d2 From 0671bb2dcdc6aea97e40bab2e8d709925c2b6471 Mon Sep 17 00:00:00 2001 From: MM <14907823+MirMiz@users.noreply.github.com> Date: Sun, 23 Apr 2023 23:37:50 +0200 Subject: changed reference to attribute which contins the date `relative-time` didn't respected the dateformat, but defaultet on UTC. The Title-Attribute (hover) now displays time in the chosen dateformat. an additional Attribut `data-date` contains the UTC-Format for calculating the relative times using JavaScript --- layouts/partials/js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/js.html b/layouts/partials/js.html index 9e4dd9d..691b8dc 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -103,7 +103,7 @@ var elements = document.querySelectorAll('.relative-time'); for (var i = 0; i < elements.length; i++) { var element = elements[i]; - var time = Date.parse(element.getAttribute('title')); + var time = Date.parse(element.dataset.date); var html = element.getAttribute('data-time-prefix') || ''; -- cgit v1.2.3-70-g09d2 From 79159ef493beab9eca85b0a8d3ad93abe870f4a1 Mon Sep 17 00:00:00 2001 From: dumbmoron Date: Thu, 30 Nov 2023 22:59:42 +0000 Subject: index.json: add pinned issues to output Adds a `pinnedIssues` key to the `index.json` object, which contains issues with `informational` and `pin` set to `true`. --- layouts/index.json | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'layouts') diff --git a/layouts/index.json b/layouts/index.json index a7ce134..23b8afa 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -17,6 +17,20 @@ } {{ end }} ], + {{ $informationals := where $incidents "Params.informational" "=" true }}{{ $pinnedIssues := where $informationals "Params.pin" "=" true }} + {{ if not $pinnedIssues }} + "pinnedIssues": []{{ else }} + "pinnedIssues": [{{ range $i, $e := $pinnedIssues }}{{ if $i }},{{ end }} + { + "is": "issue", + "title": "{{ .Title }}", + "createdAt": "{{ .Date }}", + "lastMod": "{{ .Lastmod }}", + "permalink": "{{ .Permalink }}", + "affected": [{{ range $i, $e := .Params.Affected }}{{ if $i }}, {{ end }}"{{ . }}"{{ end }}], + "filename": "{{ .File.LogicalName }}" + }{{ end }} + ]{{ end }}, "systems": [ {{ range $i, $e := .Site.Params.systems }}{{ if $i }},{{ end }} { -- cgit v1.2.3-70-g09d2 From 80d479131ecc94536074a0dfe54b0e11304d5c84 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Fri, 1 Dec 2023 14:00:08 +0200 Subject: v5.6 --- layouts/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/index.json b/layouts/index.json index a7ce134..08a75f3 100644 --- a/layouts/index.json +++ b/layouts/index.json @@ -1,6 +1,6 @@ {{ $incidents := where .Site.RegularPages "Params.section" "issue" }}{{ $active := where $incidents "Params.resolved" "=" false }}{{ $isNotice := where $active "Params.severity" "=" "notice" }}{{ $isDisrupted := where $active "Params.severity" "=" "disrupted" }}{{ $isDown := where $active "Params.severity" "=" "down" }}{ "is": "index", - "cStateVersion": "5.5.2", + "cStateVersion": "5.6", "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", -- cgit v1.2.3-70-g09d2 From 84b063191f40addb3648bfbc30d4761373f2e531 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Fri, 1 Dec 2023 14:00:26 +0200 Subject: v5.6 --- layouts/partials/js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/js.html b/layouts/partials/js.html index a5b974e..2e06196 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,7 +3,7 @@ * Dev toolset */ - console.log('cState v5.5.2 - https://github.com/cstate/cstate'); + console.log('cState v5.6 - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** -- cgit v1.2.3-70-g09d2 From 4552b3595d89f525e13a4ed3ff6ab74adad431b0 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Fri, 1 Dec 2023 14:00:43 +0200 Subject: v5.6 --- layouts/partials/meta.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'layouts') diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index da0ed46..eec0772 100644 --- a/layouts/partials/meta.html +++ b/layouts/partials/meta.html @@ -12,7 +12,7 @@ {{ range .AlternativeOutputFormats -}} {{ printf `` .Rel .MediaType.Type .Permalink $.Site.Title | safeHTML }} {{ end -}} - +