From 6a6ce102d0693b376bc744a643f014c7649b1415 Mon Sep 17 00:00:00 2001 From: Patrice Chalin Date: Thu, 7 Nov 2024 20:18:54 -0500 Subject: [PATCH] Ensure that spec_status shortcode fails softly (#5556) --- layouts/shortcodes/spec_status.html | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/layouts/shortcodes/spec_status.html b/layouts/shortcodes/spec_status.html index 3a3e85d10102..d7d83c96f7e4 100644 --- a/layouts/shortcodes/spec_status.html +++ b/layouts/shortcodes/spec_status.html @@ -6,7 +6,7 @@ {{ end -}} {{ $page := .Site.GetPage $pageRef -}} {{ if not $page -}} - {{ errorf "spec_status: Can't find page at '%s'." $pageRef -}} + {{ warnf "spec_status: Can't find page at '%s'." $pageRef -}} {{ end -}} {{ $_match := .Get 2 | default "Status" -}} @@ -17,7 +17,7 @@ {{/* Note that content is in HTML. */ -}} {{ $statusLine = index . 0 -}} {{ else -}} - {{ errorf "%s: page '%s' does not contain a line matching '%s'." $err $pageRef $_match -}} + {{ warnf "%s: page '%s' does not contain a line matching '%s'." $err $pageRef $_match -}} {{ end -}} {{ $status := "" -}} @@ -30,7 +30,8 @@ {{ with findRE $statusRE $statusLine -}} {{ $status = index . 0 -}} {{ else -}} - {{ errorf "%s: '%s' value did not match one of '%s' in file '%s': matched line is '%s'" $err $_match $statusValueRE $pageRef $statusLine -}} + {{ warnf "%s: '%s' value did not match one of '%s' in file '%s': matched line is '%s'" $err $_match $statusValueRE $pageRef $statusLine -}} + {{ $status = "[STATUS ACCESS FAILURE DURING SITE BUILD]" -}} {{ end -}} **[{{ $label }}]({{ $page.RelPermalink }}):** {{ lower $status -}}