Adapte le rapport des liens morts au nouveau format
This commit is contained in:
@@ -32,18 +32,34 @@
|
||||
|
||||
{{- $links := slice -}}
|
||||
{{- range $sourceLinks -}}
|
||||
{{- $status := "" -}}
|
||||
{{- with index . "status" -}}
|
||||
{{- $status = printf "%v" . -}}
|
||||
{{- end -}}
|
||||
{{- if eq $status "" -}}
|
||||
{{- with index . "code" -}}
|
||||
{{- $status = printf "%v" . -}}
|
||||
{{- $code := "" -}}
|
||||
{{- if isset . "code" -}}
|
||||
{{- $rawCode := index . "code" -}}
|
||||
{{- if ne $rawCode nil -}}
|
||||
{{- $code = printf "%v" $rawCode -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $statusText := "" -}}
|
||||
{{- with index . "statusText" -}}
|
||||
{{- $statusText = printf "%v" . -}}
|
||||
{{- end -}}
|
||||
{{- if eq $statusText "" -}}
|
||||
{{- with index . "status" -}}
|
||||
{{- $statusText = printf "%v" . -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
{{- $status := "" -}}
|
||||
{{- with $code -}}
|
||||
{{- $status = . -}}
|
||||
{{- end -}}
|
||||
{{- if and (eq $status "") (ne $statusText "") -}}
|
||||
{{- $status = $statusText -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $links = $links | append (dict
|
||||
"url" (default "" (index . "url"))
|
||||
"code" $code
|
||||
"statusText" $statusText
|
||||
"status" $status
|
||||
"locations" (default (slice) (index . "locations"))
|
||||
"errorType" (default "" (index . "errorType"))
|
||||
|
||||
Reference in New Issue
Block a user