Add one shortcode to display directory files

This commit is contained in:
Zhang Liang 2018-04-10 11:32:49 +08:00
parent bb54be4a4c
commit 3c3867f83a

View File

@ -0,0 +1,13 @@
{{- $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>