Extraire les partiels de calcul du thème 2026
This commit is contained in:
@@ -1,74 +0,0 @@
|
||||
{{- $reportPath := "data/external_links.yaml" -}}
|
||||
{{- $report := dict -}}
|
||||
|
||||
{{- if reflect.IsMap . -}}
|
||||
{{- with index . "ReportPath" -}}
|
||||
{{- $reportPath = . -}}
|
||||
{{- end -}}
|
||||
{{- with index . "Report" -}}
|
||||
{{- $report = . -}}
|
||||
{{- end -}}
|
||||
{{- else if . -}}
|
||||
{{- $report = . -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- if eq (len $report) 0 -}}
|
||||
{{- if eq $reportPath "data/external_links.yaml" -}}
|
||||
{{- with index site.Data "external_links" -}}
|
||||
{{- $report = . -}}
|
||||
{{- end -}}
|
||||
{{- else if fileExists $reportPath -}}
|
||||
{{- $report = transform.Unmarshal (readFile $reportPath) -}}
|
||||
{{- end -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $sourceLinks := slice -}}
|
||||
{{- with index $report "deadLinks" -}}
|
||||
{{- $sourceLinks = . -}}
|
||||
{{- end -}}
|
||||
{{- if and (eq (len $sourceLinks) 0) (isset $report "links") -}}
|
||||
{{- $sourceLinks = default (slice) (index $report "links") -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- $links := slice -}}
|
||||
{{- range $sourceLinks -}}
|
||||
{{- $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"))
|
||||
"checkedAt" (default "" (index . "checkedAt"))
|
||||
) -}}
|
||||
{{- end -}}
|
||||
|
||||
{{- return (dict
|
||||
"generatedAt" (default "" (index $report "generatedAt"))
|
||||
"entries" (default (dict) (index $report "entries"))
|
||||
"links" $links
|
||||
) -}}
|
||||
Reference in New Issue
Block a user