Add ReadDir function to list local files.

Includes documentation.
This commit is contained in:
Russell Oliver
2015-06-26 20:23:37 +10:00
committed by Bjørn Erik Pedersen
parent 72ecd0cdc7
commit 81e69c416d
4 changed files with 92 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
<table style="width=100%">
<th>Size in bytes</th>
<th>Name</th>
{{$dir := .Get "dir"}}
{{ $url := .Get "baseurl" }}
{{ $files := ReadDir $dir }}
{{ range $files }}
<tr>
<td>{{.Size}}</td>
<td>
<a href="{{$url}}{{.Name | urlize }}"> {{.Name}}</a>
</td>
</tr>
{{ end }}
</table>