From 469c6fc298d89421e0c113ed9885cc610bc38211 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Fri, 1 Oct 2021 23:30:43 +0300 Subject: need to test #208 I think the code for index.svg can be the same (or mostly the same) and be reapplied for other categories just because of how hugo parses things will get this done soon for v5.1 --- layouts/_default/list.svg | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) create mode 100644 layouts/_default/list.svg diff --git a/layouts/_default/list.svg b/layouts/_default/list.svg new file mode 100644 index 0000000..dbd6483 --- /dev/null +++ b/layouts/_default/list.svg @@ -0,0 +1,44 @@ +{{ $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" -}} +{{ $shield_prefix := .Site.Title -}} +{{ $status_text := T "thisIsOk" -}} +{{ $status_color := .Site.Params.ok -}} +{{ if $isDown -}} + {{ $status_text = T "thisIsDown" -}} + {{ $status_color = .Site.Params.down -}} +{{ else if $isDisrupted -}} + {{ $status_text = T "thisIsDisrupted" -}} + {{ $status_color = .Site.Params.disrupted -}} +{{ else if $isNotice -}} + {{ $status_text = T "thisIsNotice" -}} + {{ $status_color = .Site.Params.notice -}} +{{ end -}} +{{ $text_padding := 1 -}} +{{ $left_text_lenght := $shield_prefix | strings.RuneCount -}} +{{ $right_text_length := $status_text | strings.RuneCount -}} +{{ $left_text_padding := $text_padding -}} +{{ $right_box_padding := add (mul $text_padding 2) $left_text_lenght -}} +{{ $right_text_padding := add $right_box_padding $text_padding -}} +{{ $total_width := add (mul $text_padding 4) (add $left_text_lenght $right_text_length) -}} + + + + + + + + + + + + + + {{ $shield_prefix }} + {{ $shield_prefix }} + {{ $status_text }} + {{ $status_text }} + + -- cgit v1.2.3-70-g09d2 From 36dd93ef5b45c1a142831a311c768075eb351863 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 2 Oct 2021 12:40:58 +0300 Subject: 5.1 --- layouts/index.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/index.json b/layouts/index.json index 82c9466..2a11077 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.0.5", + "cStateVersion": "5.1", "apiVersion": "2.0", "title": "{{ .Site.Title }}", "languageCodeHTML": "{{ .Site.LanguageCode }}", -- cgit v1.2.3-70-g09d2 From f40e7af475becd12eaa99db558932f1643cb45d0 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 2 Oct 2021 12:41:26 +0300 Subject: 5.1 --- layouts/partials/js.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/js.html b/layouts/partials/js.html index c866f2b..e11de17 100644 --- a/layouts/partials/js.html +++ b/layouts/partials/js.html @@ -3,7 +3,7 @@ * Dev toolset */ - console.log('cState v5.0.5 - https://github.com/cstate/cstate'); + console.log('cState v5.1 - https://github.com/cstate/cstate'); document.getElementsByTagName('html')[0].className = 'js'; /** -- cgit v1.2.3-70-g09d2 From cea9c68f55162b1e38b7b5a76021d8c27da6a4c6 Mon Sep 17 00:00:00 2001 From: Mantas Vilčinskas Date: Sat, 2 Oct 2021 12:41:52 +0300 Subject: 5.1 --- layouts/partials/meta.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/layouts/partials/meta.html b/layouts/partials/meta.html index 5c0df56..4e7d06e 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 -}} - +