From 8dd01060710936bbdf607c6f02e73b6d529c8cf0 Mon Sep 17 00:00:00 2001 From: kingthorin Date: Wed, 5 Mar 2025 19:48:04 -0500 Subject: [PATCH] auth tests: Skip site if properties are null A site might appear to be "null" if it depends on a config.local. Signed-off-by: kingthorin --- site/layouts/shortcodes/auth-results.html | 98 ++++++++++++----------- 1 file changed, 50 insertions(+), 48 deletions(-) diff --git a/site/layouts/shortcodes/auth-results.html b/site/layouts/shortcodes/auth-results.html index c91dcd2f4..faf39808a 100644 --- a/site/layouts/shortcodes/auth-results.html +++ b/site/layouts/shortcodes/auth-results.html @@ -10,63 +10,65 @@ Note {{- range $key, $site := .Site.Data.scans.auth.output -}} - {{- range $key2, $plan := $site.plans -}} - - - {{- $site.site -}} - - {{- $key2 -}} - - {{- if $plan.auth -}} -
✓ Passed
- {{- else if not $plan.auth -}} -
❌ Failed
- {{- else -}} -
❌ N/A
- {{- end -}} - - {{- if eq $plan.username nil -}} -
- {{- else -}} - {{- if $plan.username -}} -
+ {{- with $site -}} + {{- range $key2, $plan := $site.plans -}} + + + {{- $site.site -}} + + {{- $key2 -}} + + {{- if $plan.auth -}} +
✓ Passed
+ {{- else if not $plan.auth -}} +
❌ Failed
{{- else -}} -
+
❌ N/A
{{- end -}} - {{- end -}} - - {{- if eq $plan.password nil -}} -
- {{- else -}} - {{- if $plan.password -}} -
+ + {{- if eq $plan.username nil -}} +
{{- else -}} -
+ {{- if $plan.username -}} +
+ {{- else -}} +
+ {{- end -}} {{- end -}} - {{- end -}} - - {{- if eq $plan.session nil -}} -
- {{- else -}} - {{- if $plan.session -}} -
+ + {{- if eq $plan.password nil -}} +
{{- else -}} -
+ {{- if $plan.password -}} +
+ {{- else -}} +
+ {{- end -}} {{- end -}} - {{- end -}} - - {{- if eq $plan.verification nil -}} -
- {{- else -}} - {{- if $plan.verification -}} -
+ + {{- if eq $plan.session nil -}} +
+ {{- else -}} + {{- if $plan.session -}} +
+ {{- else -}} +
+ {{- end -}} + {{- end -}} + + {{- if eq $plan.verification nil -}} +
{{- else -}} -
+ {{- if $plan.verification -}} +
+ {{- else -}} +
+ {{- end -}} {{- end -}} + + {{- $site.note -}} + {{- end -}} - - {{- $site.note -}} - {{- end -}} {{- end -}}