Implement pretty time formatting

This commit is contained in:
Chandler Swift 2021-10-18 18:07:44 -05:00
parent 64a446d04d
commit ca5a767418
Signed by: chandlerswift
GPG key ID: A851D929D52FB93F

View file

@ -102,15 +102,15 @@ func generateHTML(sites []HatsSite, w io.Writer) error {
<h3>{{.DomainName}}</h3>
<dl>
<dt>Fetched</dt>
<dd>{{.FetchTime}}</dd>
<dd>{{.FetchTime.Format "Mon Jan 2 15:04:05 -0700 MST 2006" }}</dd>
<dt>Title</dt>
<dd>{{.Title}}</dd>
<dt>Owner</dt>
<dd>{{.Owner}}</dd>
<dt>Since</dt>
<dd>{{.Since}}</dd>
<dd>{{.Since.Format "Mon Jan 2 2006" }}</dd>
</dl>
<img src="{{.ScreenshotURL}}" alt="screenshot of {{.DomainName}} as of {{.FetchTime}}">
<img src="{{.ScreenshotURL}}" alt="screenshot of {{.DomainName}} as of {{.FetchTime.Format "Mon Jan 2 15:04:05 -0700 MST 2006" }}">
{{end}}
</body>
</html>`)