go.talks/present: display articles under a separate heading to slides
R=golang-dev
CC=golang-dev
https://golang.org/cl/6878049
diff --git a/present/dir.go b/present/dir.go
index 61183b0..f309cf8 100644
--- a/present/dir.go
+++ b/present/dir.go
@@ -142,7 +142,12 @@
} else {
e.Title = p.Title
}
- d.Slides = append(d.Slides, e)
+ switch filepath.Ext(e.Path) {
+ case ".article":
+ d.Articles = append(d.Articles, e)
+ case ".slide":
+ d.Slides = append(d.Slides, e)
+ }
} else if showFile(e.Name) {
d.Other = append(d.Other, e)
}
@@ -152,6 +157,7 @@
}
sort.Sort(d.Dirs)
sort.Sort(d.Slides)
+ sort.Sort(d.Articles)
sort.Sort(d.Other)
return true, dirListTemplate.Execute(w, d)
}
@@ -177,8 +183,8 @@
}
type dirListData struct {
- Path string
- Dirs, Slides, Other dirEntrySlice
+ Path string
+ Dirs, Slides, Articles, Other dirEntrySlice
}
type dirEntry struct {
@@ -225,6 +231,15 @@
{{with .Path}}<h2>{{.}}</h2>{{end}}
+ {{with .Articles}}
+ <h4>Articles:</h4>
+ <dl>
+ {{range .}}
+ <dd><a href="/{{.Path}}">{{.Name}}</a>: {{.Title}}</dd>
+ {{end}}
+ </dl>
+ {{end}}
+
{{with .Slides}}
<h4>Slide decks:</h4>
<dl>