mirror of
https://github.com/gohugoio/hugo.git
synced 2025-08-29 22:29:56 +02:00
docs: Improve Traversing Local Files
This commit is contained in:
committed by
digitalcraftsman
parent
b86a605bfb
commit
0d1e96701f
13
docs/layouts/shortcodes/directoryindex.html
Normal file
13
docs/layouts/shortcodes/directoryindex.html
Normal 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>
|
Reference in New Issue
Block a user