Switch to "html/template" and improve the package page

This improves the look of each "package" page, especially with more useful information and links. 👍

Also, this switches the Git clone URLs to "https" (see https://help.github.com/articles/which-remote-url-should-i-use/), and adds an explicit "URL" for each package so we can link to browsable source code.
This commit is contained in:
Tianon Gravi 2015-08-08 09:01:44 -07:00
parent 2fd844bd80
commit 4f39be8f0c
3 changed files with 41 additions and 10 deletions

15
template.html Normal file
View file

@ -0,0 +1,15 @@
<!DOCTYPE html><html>
<head>
<meta charset="utf-8">
<title>{{ .Path }}</title>
<meta name="go-import" content="{{ .Path }} git {{ .Repo }}">
</head>
<body>
<div>package: <code>{{ .Path }}</code></div>
<div>source: <a href="{{ .Url }}">{{ .Url }}</a></div>
<div>godocs:<ul>
<li><a href="https://godoc.org/{{ .Path }}">{{ .Path }}</a></li>{{range .Packages}}
<li><a href="https://godoc.org/{{ $.Path }}/{{ . }}">{{ $.Path }}/{{ . }}</a></li>{{end}}
</ul></div>
</body>
</html>