{{- $rows := "" -}} {{- $filename := .Get 0 -}} {{- $class := (cond (isset $.Params 1) (.Get 1) "No Param $1") -}} {{- $caption := (cond (isset $.Params 2) (.Get 2) "No Param $1") -}} {{- with .Page.Resources.Get $filename -}} {{- $options := dict "delimiter" "," -}} {{- $rows = .Content | transform.Unmarshal $options -}} {{- $headerRow := index $rows 0 -}} {{- $dataRows := after 1 $rows -}} {{- range $headerRow -}} {{- end -}} {{- range $rowIndex, $columns := $dataRows -}} {{- range $col := $columns -}} {{- end -}} {{- end -}}
{{ $caption | safeHTML }}
{{ . }}
{{ . | safeHTML }}
{{- else -}} {{ errorf "Unable to get the page resource: %q" $filename }}

CSV file not found: {{ $filename }}

{{- end -}}