Clean up template

This commit is contained in:
Chandler Swift 2021-10-18 19:28:23 -05:00
parent 373fc1e0f2
commit de7f70b11d
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

12
main.go
View file

@ -139,17 +139,21 @@ func generateHTML(sites []HatsSite, w io.Writer) error {
<dl>
<dt>Fetched</dt>
<dd>{{.FetchTime.Format "Mon Jan 2 15:04:05 -0700 MST 2006" }}</dd>
<dt>Title</dt>
<dd>{{.Title}}</dd>
<dt>Owner</dt>
<dd><a href="mailto:{{.Registrant.Email}}">{{.Registrant.Name}} &lt;{{.Registrant.Email}}&gt</a></dd>
{{with .DomainInfo.CreatedDate}}
{{if not .Available}}
<dt>Since</dt>
<dd>{{(parseTime .).Format "Mon Jan 2 2006" }}</dd>
<dd>{{(parseTime .DomainInfo.CreatedDate).Format "Mon Jan 2 2006" }}</dd>
{{end}}
{{with .Title}}
<dt>Title</dt>
<dd>{{.}}</dd>
{{end}}
</dl>
{{if .ScreenshotURL}}
<img src="{{.ScreenshotURL}}" alt="screenshot of {{.DomainName}} as of {{.FetchTime.Format "Mon Jan 2 15:04:05 -0700 MST 2006" }}">
{{end}}
{{end}}
</body>
</html>`)
if err != nil {