summaryrefslogtreecommitdiff
path: root/pem2html.go
diff options
context:
space:
mode:
Diffstat (limited to 'pem2html.go')
-rw-r--r--pem2html.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/pem2html.go b/pem2html.go
index 02918cf..fda259f 100644
--- a/pem2html.go
+++ b/pem2html.go
@@ -75,6 +75,9 @@ var tmpl = template.Must(template.New("pem2html").
</head>
<body>
<table class=sortable>
+ <caption>
+ <p>Updated {{.now.Local.Format "2006-01-02 15:04:05"}}</p>
+ </caption>
<tr>
<th>Logged</th>
<th>NotBefore</th>
@@ -82,7 +85,7 @@ var tmpl = template.Must(template.New("pem2html").
<th>Subject.CN</th>
<th>Issuer.O</th>
</tr>
-{{range $cert := .}}
+{{range $cert := .certs}}
<tr>
<td style="background-color: {{$cert.Updated | green}}"><a target="_blank" href="{{$cert.Url}}">{{$cert.Updated.Local.Format "2006-01-02 15:04:05"}}</a></td>
<td><a target="_blank" href="{{$cert.Url}}">{{$cert.X509.NotBefore.Local.Format "2006-01-02"}}</a></td>
@@ -93,7 +96,8 @@ var tmpl = template.Must(template.New("pem2html").
{{end}}
</table>
</body>
-</html>`))
+</html>
+`))
var now = time.Now()
@@ -196,5 +200,5 @@ func main() {
}
sort.Sort(certs)
- handleErr(tmpl.Execute(os.Stdout, certs), "Could not execute template: %v\n")
+ handleErr(tmpl.Execute(os.Stdout, map[string]interface{}{"certs":certs, "now": now}), "Could not execute template: %v\n")
}