Reviewers: campoy,
Message:
Hello campoy (cc: golang-dev@googlegroups.com),
I'd like you to review this change to
https://code.google.com/p/go.talks
Description:
go.talks/present: simplify table of contents template
Please review this at https://codereview.appspot.com/6872047/
Affected files:
M present/templates/article.tmpl
Index: present/templates/article.tmpl
===================================================================
--- a/present/templates/article.tmpl
+++ b/present/templates/article.tmpl
@@ -19,9 +19,9 @@
</div>
<div id="page" class="wide">
<div class="container">
- {{with $toc := .Sections}}
+ {{with .Sections}}
<div id="toc">
- {{range .}}{{template "TOC" .}}{{end}}
+ {{template "TOC" .}}
</div>
{{end}}
@@ -44,12 +44,10 @@
{{define "TOC"}}
<ul>
+ {{range .}}
<li><a href="#TOC_{{.FormattedNumber}}">{{.Title}}</a></li>
- {{with .Sections}}
- <ul>
- {{range .}}{{template "TOC" .}}{{end}}
- </ul>
- {{end}}
+ {{with .Sections}}{{template "TOC" .}}{{end}}
+ {{end}}
</ul>
{{end}}