I’m trying to export a CSV to table and can’t find a way to find the file, so I went crazy mode:
ERROR The “csv-to-table” shortcode was unable to find test.csv. See “C:\Users\me\Desktop\pixdocs\content\docs\siglas_index.md:12:1”
_index.md:12:1
### Title
{{< csv-to-table "test.csv" >}}
csv-to-table.html
{{ with $file := .Get 0 }}
{{ with resources.Get $file }}
{{ with . | transform.Unmarshal }}
<table>
<thead>
<tr>
{{ range index . 0 }}
<th>{{ . }}</th>
{{ end }}
</tr>
</thead>
<tbody>
{{ range after 1 . }}
<tr>
{{ range . }}
<td>{{ . }}</td>
{{ end }}
</tr>
{{ end }}
</tbody>
</table>
{{ end }}
{{ else }}
{{ errorf "The %q shortcode was unable to find %s. See %s" $.Name $file $.Position }}
{{ end }}
{{ else }}
{{ errorf "The %q shortcode requires one positional argument, the path to the CSV file relative to the assets directory. See %s" .Name .Position }}
{{ end }}
hugo env
hugo v0.128.2-de36c1a95d28595d8243fd8b891665b069ed0850 windows/amd64 BuildDate=2024-07-04T08:13:25Z VendorInfo=gohugoio
GOOS=“windows”
GOARCH=“amd64”
GOVERSION=“go1.22.2”