Prevent errors with no data folder

rust
Elnu 2 years ago
parent 65b6dfad7a
commit d2fa6c8fc4

@ -121,6 +121,7 @@
{{- define "secondary" -}} {{- define "secondary" -}}
{{- $current := replaceRE `[^0-9]` "" .File -}} {{- $current := replaceRE `[^0-9]` "" .File -}}
<div id="submissions"> <div id="submissions">
{{- if isset .Site.Data "challenges" -}}
{{- range index .Site.Data.challenges ($current) -}} {{- range index .Site.Data.challenges ($current) -}}
{{- $submission := . -}} {{- $submission := . -}}
{{- range.images -}} {{- range.images -}}
@ -129,6 +130,7 @@
{{- partial "submission.html" (dict "submission" $submission "challenge" $current "image" $image) -}} {{- partial "submission.html" (dict "submission" $submission "challenge" $current "image" $image) -}}
{{- end -}} {{- end -}}
{{- end -}} {{- end -}}
{{- end -}}
</div> </div>
{{- end -}} {{- end -}}

Loading…
Cancel
Save