Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure that spec_status shortcode fails softly #5556

Merged
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions layouts/shortcodes/spec_status.html
Original file line number Diff line number Diff line change
Expand Up @@ -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" -}}
Expand All @@ -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 := "" -}}
Expand All @@ -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 -}}