hugo-xmin/layouts/shortcodes/directoryindex.html
2018-04-10 11:32:49 +08:00

14 lines
351 B
HTML

{{- $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>