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 -}} {{- $chapters := slice -}}
{{- with .Params.chapters -}} {{- with .Params.chapters -}}
{{- range . -}} {{- 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 -}} {{- $entry := dict "startTime" $start_time_value "title" .title -}}
{{- with .image -}} {{- with .image -}}
{{- $entry = collections.Merge $entry (dict "img" .image) -}} {{- $entry = collections.Merge $entry (dict "img" .) -}}
{{- end -}} {{- end -}}
{{- with .url -}} {{- with .url -}}
{{- $entry = collections.Merge $entry (dict "url" .url) -}} {{- $entry = collections.Merge $entry (dict "url" .) -}}
{{- end -}} {{- end -}}
{{- with .toc -}} {{- with .toc -}}
{{- $entry = collections.Merge $entry (dict "toc" .toc) -}} {{- $entry = collections.Merge $entry (dict "toc" .) -}}
{{- end -}} {{- end -}}
{{- with .end_time -}} {{- 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) -}} {{- $entry = collections.Merge $entry (dict "endTime" $end_time_value) -}}
{{- end -}} {{- end -}}
{{- with .location -}} {{- with .location -}}
{{- $name := collections.Index .location "name" -}} {{- $name := collections.Index . "name" -}}
{{- $geo := collections.Index .location "geo" -}} {{- $geo := collections.Index . "geo" -}}
{{- $entry = collections.Merge $entry (dict "location" (dict "name" $name "geo" $geo)) -}} {{- $entry = collections.Merge $entry (dict "location" (dict "name" $name "geo" $geo)) -}}
{{- end -}} {{- end -}}
{{- $chapters = collections.Append $entry $chapters -}} {{- $chapters = collections.Append $entry $chapters -}}