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> <h3>{{.DomainName}}</h3>
<dl> <dl>
<dt>Fetched</dt> <dt>Fetched</dt>
<dd>{{.FetchTime}}</dd> <dd>{{.FetchTime.Format "Mon Jan 2 15:04:05 -0700 MST 2006" }}</dd>
<dt>Title</dt> <dt>Title</dt>
<dd>{{.Title}}</dd> <dd>{{.Title}}</dd>
<dt>Owner</dt> <dt>Owner</dt>
<dd>{{.Owner}}</dd> <dd>{{.Owner}}</dd>
<dt>Since</dt> <dt>Since</dt>
<dd>{{.Since}}</dd> <dd>{{.Since.Format "Mon Jan 2 2006" }}</dd>
</dl> </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}} {{end}}
</body> </body>
</html>`) </html>`)