blob: c17b27f76779f83d020bdaf4e12f392d875c21f0 [file] [log] [blame]
{{define "Analytics"}}{{with gaAccount}}<script type="text/javascript">
var _gaq = _gaq || [];
_gaq.push(['_setAccount', '{{.}}']);
_gaq.push(['_trackPageview']);
(function() {
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>{{end}}{{end}}
{{define "SearchBox"}}
<form>
<div class="input-group">
<input class="form-control" name="q" autofocus="autofocus" value="{{.}}" placeholder="Search for package by import path or keyword." type="text">
<span class="input-group-btn">
<button class="btn btn-default" type="submit">Go!</button>
</span>
</div>
</form>
{{end}}
{{define "ProjectNav"}}{{template "FlashMessages" .flashMessages}}<div class="clearfix" id="x-projnav">
{{if .pdoc.ProjectRoot}}{{if .pdoc.ProjectURL}}<a href="{{.pdoc.ProjectURL}}"><strong>{{.pdoc.ProjectName}}:</strong></a>{{else}}<strong>{{.pdoc.ProjectName}}:</strong>{{end}}{{else}}<a href="/-/go">Go:</a>{{end}}
{{.pdoc.Breadcrumbs templateName}}
{{if and .pdoc.Name (equal templateName "pkg.html")}}
<span class="pull-right">
<a href="#pkg-index">Index</a>
{{if .pdoc.AllExamples}}<span class="text-muted">|</span> <a href="#pkg-examples">Examples</a>{{end}}
<span class="text-muted">|</span> <a href="#pkg-files">Files</a>
{{if .pkgs}}<span class="text-muted">|</span> <a href="#pkg-subdirectories">Directories</a>{{end}}
</span>
{{end}}
</div>{{end}}
{{define "Pkgs"}}
<table class="table table-condensed">
<thead><tr><th>Path</th><th>Synopsis</th></tr></thead>
<tbody>{{range .}}<tr><td>{{if .Path|isValidImportPath}}<a href="/{{.Path}}">{{.Path|importPath}}</a>{{else}}{{.Path|importPath}}{{end}}</td><td>{{.Synopsis|importPath}}</td></tr>
{{end}}</tbody>
</table>
{{end}}
{{define "PkgCmdHeader"}}{{with .pdoc}}
<title>{{.PageName}} - GoDoc</title>
{{if .Synopsis}}
<meta name="twitter:title" content="{{if .IsCmd}}Command{{else}}Package{{end}} {{.PageName}}">
<meta property="og:title" content="{{if .IsCmd}}Command{{else}}Package{{end}} {{.PageName}}">
<meta name="description" content="{{.Synopsis}}">
<meta name="twitter:description" content="{{.Synopsis}}">
<meta property="og:description" content="{{.Synopsis}}">
<meta name="twitter:card" content="summary">
<meta name="twitter:site" content="@golang">
{{end}}
{{if .Errors}}<meta name="robots" content="NOINDEX">{{end}}
{{end}}{{end}}
{{define "PkgCmdFooter"}}
<!-- Bugs -->
{{with .pdoc}}{{with .Notes}}{{with .BUG}}
<h3 id="pkg-note-bug">Bugs <a class="permalink" href="#pkg-note-bug">&para;</a></h3>{{range .}}<p>{{$.pdoc.SourceLink .Pos "☞" true}} {{.Body}}{{end}}
{{end}}{{end}}{{end}}
{{if $.pkgs}}<h3 id="pkg-subdirectories">Directories <a class="permalink" href="#pkg-subdirectories">&para;</a></h3>
<table class="table table-condensed">
<thead><tr><th>Path</th><th>Synopsis</th></tr></thead>
<tbody>{{range $.pkgs}}<tr><td><a href="/{{.Path}}">{{relativePath .Path $.pdoc.ImportPath}}</a><td>{{.Synopsis}}</td></tr>{{end}}</tbody>
</table>
{{end}}
<div id="x-pkginfo">
{{with $.pdoc}}
<form name="x-refresh" method="POST" action="/-/refresh"><input type="hidden" name="path" value="{{.ImportPath}}"></form>
<p>{{if or .Imports $.importerCount}}Package {{.Name}} {{if .Imports}}imports <a href="?imports">{{.Imports|len}} packages</a> (<a href="?import-graph">graph</a>){{end}}{{if and .Imports $.importerCount}} and {{end}}{{if $.importerCount}}is imported by <a href="?importers">{{$.importerCount}} packages</a>{{end}}.{{end}}
{{if not .Updated.IsZero}}Updated <span class="timeago" title="{{.Updated.Format "2006-01-02T15:04:05Z"}}">{{.Updated.Format "2006-01-02"}}</span>{{if or (equal .GOOS "windows") (equal .GOOS "darwin")}} with GOOS={{.GOOS}}{{end}}.{{end}}
<a href="javascript:document.getElementsByName('x-refresh')[0].submit();" title="Refresh this page from the source.">Refresh now</a>.
<a href="?tools">Tools</a> for package owners.
{{if .DeadEndFork}}This is a dead-end fork (no commits since the fork).{{end}}
{{end}}
{{with $.pdoc.Errors}}
<p>The <a href="http://golang.org/cmd/go/#Download_and_install_packages_and_dependencies">go get</a>
command cannot install this package because of the following issues:
<ul>
{{range .}}<li>{{.}}{{end}}
</ul>
{{end}}
</div>
{{end}}
{{define "Bootstrap.css"}}<link href="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/css/bootstrap.min.css" rel="stylesheet">{{end}}
{{define "Bootstrap.js"}}<script src="//maxcdn.bootstrapcdn.com/bootstrap/3.3.1/js/bootstrap.min.js"></script>{{end}}
{{define "jQuery"}}<script src="//code.jquery.com/jquery-2.0.3.min.js"></script>{{end}}
{{define "FlashMessages"}}{{range .}}
{{if eq .ID "redir"}}{{if eq (len .Args) 1}}<div class="alert alert-warning">Redirected from {{index .Args 0}}.</div>{{end}}
{{else if eq .ID "refresh"}}{{if eq (len .Args) 1}}<div class="alert alert-danger">Error refreshing package: {{index .Args 0}}</div>{{end}}
{{end}}
{{end}}{{end}}