hugo-xmin/layouts/shortcodes/directoryindex.html

14 lines
351 B
HTML
Raw Normal View History

{{- $pathURL := .Get "pathURL" -}}
{{- $path := .Get "path" -}}
{{- $files := readDir $path -}}
<table>
<th>文件大小(字节)</th>
<th>文件名称</th>
{{- range $files }}
<tr>
<td>{{ .Size }}</td>
<td><a href="{{ $pathURL }}{{ .Name | relURL }}" target="_blank"> {{ .Name }}</a></td>
</tr>
{{- end }}
</table>