cmd/golangorg: clean up directory listings

The time stamps are unlikely to be useful or correct.
Today golang.org shows the release time for all files,
which has zero information content. Drop them.

Do not show size for directories - it's meaningless.

Show all directories before all files for easier navigation
and to keep package sources listed more compactly.

Change-Id: I06247988003e310aa19ecec7399b94f315e323bd
Reviewed-on: https://go-review.googlesource.com/c/website/+/293495
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
diff --git a/_content/lib/godoc/dirlist.html b/_content/lib/godoc/dirlist.html
index a3e1a2f..78530e6 100644
--- a/_content/lib/godoc/dirlist.html
+++ b/_content/lib/godoc/dirlist.html
@@ -10,22 +10,16 @@
 	<th align="left">File</th>
 	<td width="25">&nbsp;</td>
 	<th align="right">Bytes</th>
-	<td width="25">&nbsp;</td>
-	<th align="left">Modified</th>
 </tr>
 <tr>
-	<td><a href="..">..</a></td>
+	<td><a href="../">../</a></td>
 </tr>
-{{range .}}
-<tr>
-	{{$name_html := fileInfoName . | html}}
-	<td align="left"><a href="{{$name_html}}">{{$name_html}}</a></td>
-	<td></td>
-	<td align="right">{{html .Size}}</td>
-	<td></td>
-	<td align="left">{{fileInfoTime . | html}}</td>
-</tr>
-{{end}}
+{{range .}}{{if .IsDir}}
+	<tr><td align="left"><a href="{{html .Name}}/">{{html .Name}}/</a><td></tr>
+{{end}}{{end}}
+{{range .}}{{if not .IsDir}}
+	<tr><td align="left"><a href="{{html .Name}}">{{html .Name}}</a><td align="right">{{html .Size}}</tr>
+{{end}}{{end}}
 
 </table>
 </p>
diff --git a/internal/godoc/godoc.go b/internal/godoc/godoc.go
index c23d549..c9b1836 100644
--- a/internal/godoc/godoc.go
+++ b/internal/godoc/godoc.go
@@ -23,7 +23,6 @@
 	"go/token"
 	"io"
 	"log"
-	"os"
 	pathpkg "path"
 	"regexp"
 	"strconv"
@@ -65,13 +64,8 @@
 	p.funcMap = template.FuncMap{
 		// various helpers
 		"filename": filenameFunc,
-		"repeat":   strings.Repeat,
 		"since":    p.Corpus.pkgAPIInfo.sinceVersionFunc,
 
-		// access to FileInfos (directory listings)
-		"fileInfoName": fileInfoNameFunc,
-		"fileInfoTime": fileInfoTimeFunc,
-
 		// formatting of AST nodes
 		"node":         p.nodeFunc,
 		"node_html":    p.node_htmlFunc,
@@ -122,21 +116,6 @@
 	return localname
 }
 
-func fileInfoNameFunc(fi os.FileInfo) string {
-	name := fi.Name()
-	if fi.IsDir() {
-		name += "/"
-	}
-	return name
-}
-
-func fileInfoTimeFunc(fi os.FileInfo) string {
-	if t := fi.ModTime(); t.Unix() != 0 {
-		return t.Local().String()
-	}
-	return "" // don't return epoch if time is obviously not set
-}
-
 func (p *Presentation) nodeFunc(info *PageInfo, node interface{}) string {
 	var buf bytes.Buffer
 	p.writeNode(&buf, info, info.FSet, node)