diff --git a/content/templates/local-file-templates.md b/content/templates/local-file-templates.md
index d46056bf3..39ceaee97 100644
--- a/content/templates/local-file-templates.md
+++ b/content/templates/local-file-templates.md
@@ -2,6 +2,7 @@
title: Local File Templates
linktitle: Local File Templates
description:
+godocref: https://golang.org/pkg/os/#FileInfo
date: 2017-02-01
publishdate: 2017-02-01
lastmod: 2017-02-01
@@ -45,16 +46,20 @@ So, let's create a new shortcode using `readDir`:
For the files in any given directory, this shortcode usefully lists their basenames and sizes, while providing links to them.
-Already—actually—this shortcode
-has been included in this very web site.
-So, let's list some of its CSS files.
-(If you click on their names, you can reveal the contents.)
-{{* directoryindex path="/static/css" pathURL="/css" */>}}
+This shortcode [has already been included in this very web site][].
+So, let's list some of its CSS files. (If you click on their names, you can reveal the contents.)
+
+{{< directoryindex path="/static/css" pathURL="/css" >}}
+
This is the call that rendered the above output:
+
```html
{{* directoryindex path="/static/css" pathURL="/css" */>}}
```
-By the way,
-regarding the pathURL argument, the initial slash `/` is important.
-Otherwise, it becomes relative to the current web page.
\ No newline at end of file
+
+{{% note "Slashes are Important" %}}
+The initial slash `/` in `pathURL` is important. Otherwise, `pathURL` becomes relative to the current web page.
+{{% /note %}}
+
+[has already been included in this very web site]: https://github.com/spf13/hugo/blob/master/docs/layouts/shortcodes/directoryindex.html
\ No newline at end of file
diff --git a/layouts/shortcodes/directoryindex.html b/layouts/shortcodes/directoryindex.html
new file mode 100644
index 000000000..4205d4347
--- /dev/null
+++ b/layouts/shortcodes/directoryindex.html
@@ -0,0 +1,13 @@
+{{- $pathURL := .Get "pathURL" -}}
+{{- $path := .Get "path" -}}
+{{- $files := readDir $path -}}
+
Size in bytes | +Name | +{{- range $files }} +
---|---|
{{ .Size }} | +{{ .Name }} | +