fix: several syntax errors

This commit is contained in:
Florian Maury 2024-10-27 15:27:35 +01:00
parent c7d353502b
commit 82381276b2

View file

@ -1,24 +1,24 @@
{{- $chapters := slice -}}
{{- with .Params.chapters -}}
{{- range . -}}
{{- $start_time_value := printf "%.3f" .start_time | cast.ToFloat -}}
{{- $start_time_value := printf "%.3f" (cast.ToFloat .start_time ) | cast.ToFloat -}}
{{- $entry := dict "startTime" $start_time_value "title" .title -}}
{{- with .image -}}
{{- $entry = collections.Merge $entry (dict "img" .image) -}}
{{- $entry = collections.Merge $entry (dict "img" .) -}}
{{- end -}}
{{- with .url -}}
{{- $entry = collections.Merge $entry (dict "url" .url) -}}
{{- $entry = collections.Merge $entry (dict "url" .) -}}
{{- end -}}
{{- with .toc -}}
{{- $entry = collections.Merge $entry (dict "toc" .toc) -}}
{{- $entry = collections.Merge $entry (dict "toc" .) -}}
{{- end -}}
{{- with .end_time -}}
{{- $end_time_value := printf "%.3f" .end_time | cast.ToFloat -}}
{{- $end_time_value := printf "%.3f" (cast.ToFloat . ) | cast.ToFloat -}}
{{- $entry = collections.Merge $entry (dict "endTime" $end_time_value) -}}
{{- end -}}
{{- with .location -}}
{{- $name := collections.Index .location "name" -}}
{{- $geo := collections.Index .location "geo" -}}
{{- $name := collections.Index . "name" -}}
{{- $geo := collections.Index . "geo" -}}
{{- $entry = collections.Merge $entry (dict "location" (dict "name" $name "geo" $geo)) -}}
{{- end -}}
{{- $chapters = collections.Append $entry $chapters -}}