go.talks/present: Only pull in play.js if play is enabled.
R=adg
CC=golang-dev
https://golang.org/cl/7098071
diff --git a/pkg/present/parse.go b/pkg/present/parse.go
index 6fa338d..d676d6d 100644
--- a/pkg/present/parse.go
+++ b/pkg/present/parse.go
@@ -34,8 +34,9 @@
func (d *Doc) Render(w io.Writer, t *template.Template) error {
data := struct {
*Doc
- Template *template.Template
- }{d, t}
+ Template *template.Template
+ PlayEnabled bool
+ }{d, t, PlayEnabled}
return t.ExecuteTemplate(w, "root", data)
}
diff --git a/present/templates/slides.tmpl b/present/templates/slides.tmpl
index 93d874e..d2abfa1 100644
--- a/present/templates/slides.tmpl
+++ b/present/templates/slides.tmpl
@@ -47,7 +47,9 @@
</article>
</body>
+ {{if .PlayEnabled}}
<script src='/play.js'></script>
+ {{end}}
</html>
{{end}}