FAQ
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}}

Search Discussions

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 1 of 1 | next ›
Discussion Overview
groupgolang-dev @
categoriesgo
postedDec 2, '12 at 10:03p
activeDec 2, '12 at 10:03p
posts1
users1
websitegolang.org

1 user in discussion

Adg: 1 post

People

Translate

site design / logo © 2022 Grokbase