mirror of
https://github.com/golang/go
synced 2024-11-18 14:14:46 -07:00
6a71ab8780
There is no need to add play.js in article page when playground is disabled. Signed-off-by: Tw <tw19881113@gmail.com> Change-Id: If40d256c89d7bd37efff9e08bb176bd3ea2d6f88 Reviewed-on: https://go-review.googlesource.com/16415 Reviewed-by: Andrew Gerrand <adg@golang.org>
90 lines
2.7 KiB
Cheetah
90 lines
2.7 KiB
Cheetah
{/* This is the article template. It defines how articles are formatted. */}
|
|
|
|
{{define "root"}}
|
|
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<title>{{.Title}}</title>
|
|
<link type="text/css" rel="stylesheet" href="/static/article.css">
|
|
<meta charset='utf-8'>
|
|
<script>
|
|
// Initialize Google Analytics tracking code on production site only.
|
|
if (window["location"] && window["location"]["hostname"] == "talks.golang.org") {
|
|
var _gaq = _gaq || [];
|
|
_gaq.push(["_setAccount", "UA-11222381-6"]);
|
|
_gaq.push(["b._setAccount", "UA-49880327-6"]);
|
|
window.trackPageview = function() {
|
|
_gaq.push(["_trackPageview", location.pathname+location.hash]);
|
|
_gaq.push(["b._trackPageview", location.pathname+location.hash]);
|
|
};
|
|
window.trackPageview();
|
|
window.trackEvent = function(category, action, opt_label, opt_value, opt_noninteraction) {
|
|
_gaq.push(["_trackEvent", category, action, opt_label, opt_value, opt_noninteraction]);
|
|
_gaq.push(["b._trackEvent", category, action, opt_label, opt_value, opt_noninteraction]);
|
|
};
|
|
}
|
|
</script>
|
|
</head>
|
|
|
|
<body>
|
|
<div id="topbar" class="wide">
|
|
<div class="container">
|
|
<div id="heading">{{.Title}}
|
|
{{with .Subtitle}}{{.}}{{end}}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<div id="page" class="wide">
|
|
<div class="container">
|
|
{{with .Sections}}
|
|
<div id="toc">
|
|
{{template "TOC" .}}
|
|
</div>
|
|
{{end}}
|
|
|
|
{{range .Sections}}
|
|
{{elem $.Template .}}
|
|
{{end}}{{/* of Section block */}}
|
|
|
|
{{if .Authors}}
|
|
<h2>Authors</h2>
|
|
{{range .Authors}}
|
|
<div class="author">
|
|
{{range .Elem}}{{elem $.Template .}}{{end}}
|
|
</div>
|
|
{{end}}
|
|
{{end}}
|
|
</div>
|
|
</div>
|
|
|
|
{{if .PlayEnabled}}
|
|
<script src='/play.js'></script>
|
|
{{end}}
|
|
|
|
<script>
|
|
(function() {
|
|
// Load Google Analytics tracking code on production site only.
|
|
if (window["location"] && window["location"]["hostname"] == "talks.golang.org") {
|
|
var ga = document.createElement("script"); ga.type = "text/javascript"; ga.async = true;
|
|
ga.src = ("https:" == document.location.protocol ? "https://ssl" : "http://www") + ".google-analytics.com/ga.js";
|
|
var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(ga, s);
|
|
}
|
|
})();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
{{end}}
|
|
|
|
{{define "TOC"}}
|
|
<ul>
|
|
{{range .}}
|
|
<li><a href="#TOC_{{.FormattedNumber}}">{{.Title}}</a></li>
|
|
{{with .Sections}}{{template "TOC" .}}{{end}}
|
|
{{end}}
|
|
</ul>
|
|
{{end}}
|
|
|
|
{{define "newline"}}
|
|
{{/* No automatic line break. Paragraphs are free-form. */}}
|
|
{{end}}
|