docs: Improve Traversing Local Files

This commit is contained in:
Mark D. Blackwell
2016-09-10 18:23:23 -04:00
committed by digitalcraftsman
parent b86a605bfb
commit 0d1e96701f
4 changed files with 50 additions and 46 deletions

View File

@@ -0,0 +1,13 @@
{{- $pathURL := .Get "pathURL" -}}
{{- $path := .Get "path" -}}
{{- $files := readDir $path -}}
<table>
<th>Size in bytes</th>
<th>Name</th>
{{- range $files }}
<tr>
<td>{{ .Size }}</td>
<td><a href="{{ $pathURL }}{{ .Name | relURL }}"> {{ .Name }}</a></td>
</tr>
{{- end }}
</table>

View File

@@ -1,16 +0,0 @@
<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>

View File

@@ -0,0 +1 @@
{{- .Get 0 | readFile -}}