blob: c30f6a4f6ca5c93183a1f345b6a0d5aed516b7e0 [file] [log] [blame]
{{/* This template is combined with other templates to render blog pages. */}}
{{define "root"}}
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>{{template "title" .}}</title>
<link type="text/css" rel="stylesheet" href="/lib/godoc/style.css">
<link rel="alternate" type="application/atom+xml" title="blog.golang.org - Atom Feed" href="http://blog.golang.org/feed.atom" />
<script type="text/javascript">window.initFuncs = [];</script>
<style>
#sidebar {
float: right;
padding-left: 20px;
width: 250px;
background: white;
}
#sidebar p, #sidebar ul {
margin: 20px 5px;
}
#sidebar ul {
padding: 0;
}
#sidebar li {
list-style-type: none;
}
#content .author {
font-style: italic;
}
#content .article {
margin-bottom: 50px;
}
#content .date {
color: #999;
}
#content .tags {
color: #999;
font-size: smaller;
}
#content .iframe, #content .image {
margin: 20px;
}
</style>
</head>
<body>
<div id="topbar"><div class="container">
<form method="GET" action="{{.GodocURL}}/search">
<div id="menu">
<a href="{{.GodocURL}}/doc/">Documents</a>
<a href="{{.GodocURL}}/pkg/">Packages</a>
<a href="{{.GodocURL}}/project/">The Project</a>
<a href="{{.GodocURL}}/help/">Help</a>
<a href="{{.GodocURL}}/blog/">Blog</a>
<input type="text" id="search" name="q" class="inactive" value="Search" placeholder="Search">
</div>
<div id="heading"><a href="{{.GodocURL}}/">The Go Programming Language</a></div>
</form>
</div></div>
<div id="page">
<div class="container">
<div id="sidebar">
{{with .Doc}}
{{with .Newer}}
<h4>Next article</h4>
<p><a href="{{.Path}}">{{.Title}}</a></p>
{{end}}
{{with .Older}}
<h4>Previous article</h4>
<p><a href="{{.Path}}">{{.Title}}</a></p>
{{end}}
{{with .Related}}
<h4>Related articles</h4>
<ul>
{{range .}}
<li><a href="{{.Path}}">{{.Title}}</a></li>
{{end}}
</ul>
{{end}}
{{end}}
<h4>Links</h4>
<ul>
<li><a href='http://golang.org/'>golang.org</a></li>
<li><a href='http://golang.org/doc/install.html'>Install Go</a></li>
<li><a href='http://tour.golang.org/'>A Tour of Go</a></li>
<li><a href='http://golang.org/doc/'>Go Documentation</a></li>
<li><a href='http://groups.google.com/group/golang-nuts'>Go Mailing List</a></li>
<li><a href='https://plus.google.com/101406623878176903605'>Go on Google+</a></li>
<li><a href='https://plus.google.com/112164155169467723645/posts'>Go+ Community</a></li>
<li><a href='http://twitter.com/go_nuts'>Go on Twitter</a></li>
</ul>
<h4>Keep up with Google Developers</h4>
<ul>
<li><a href='https://plus.google.com/+GoogleDevelopers/posts'>Google Developers +Page</a></li>
<li><a href='https://developers.google.com/live/'>Google Developers Live</a></li>
<li><a href='https://developers.google.com/'>Google Developers</a></li>
<li><a href='http://googledevelopers.blogspot.com/'>Google Developers Blog</a></li>
</ul>
<h4>Blog Archive</h4>
<p><a href="{{.BasePath}}/index">Article index</a></p>
</div><!-- #sidebar -->
<div id="content">
{{template "content" .}}
</div><!-- #content -->
<div id="footer">
<p>
Except as
<a href="http://code.google.com/policies.html#restrictions">noted</a>,
the content of this page is licensed under the Creative Commons
Attribution 3.0 License,<br>
and code is licensed under a <a href="/LICENSE">BSD license</a>.<br>
<a href="http://golang.org/doc/tos.html">Terms of Service</a> |
<a href="http://www.google.com/intl/en/policies/privacy/">Privacy Policy</a>
</p>
</div><!-- #footer -->
</div><!-- .container -->
</div><!-- #page -->
</body>
<script src="/lib/godoc/jquery.js"></script>
<script src="/lib/godoc/playground.js"></script>
<script src="/lib/godoc/play.js"></script>
<script src="/lib/godoc/godocs.js"></script>
<script>
$(function() {
// Insert line numbers for all playground elements.
$('.playground').each(function() {
var $spans = $(this).find('> pre > span');
// Compute width of number column (including trailing space).
var max = 0;
$spans.each(function() {
var n = $(this).attr('num')*1;
if (n > max) max = n;
});
var width = 2;
while (max > 10) {
max = max / 10;
width++;
}
// Insert line numbers with space padding.
$spans.each(function() {
var n = $(this).attr('num')+' ';
while (n.length < width) n = ' '+n;
$('<span class="number">').text(n).insertBefore(this);
});
});
initPlayground(new HTTPTransport());
});
</script>
</html>
{{end}}
{{define "doc"}}
<div class="article">
<h1 class="title"><a href="{{.Path}}">{{.Title}}</a></h1>
<p class="date">{{.Time.Format "2 January 2006"}}</p>
{{.HTML}}
{{with .Authors}}
<p class="author">By {{authors .}}</p>
{{end}}
</div>
{{end}}