Cleanup and show just a week

This commit is contained in:
Peter Stuifzand 2019-12-23 22:08:56 +01:00
parent 3f06fd8aad
commit 745da46fb6
2 changed files with 9 additions and 3 deletions

View File

@ -23,7 +23,6 @@ import (
type Summary struct {
PostTypes map[string]string
Name string
Published string
Items []microsub.Item
Grouped map[string][]microsub.Item
}
@ -59,7 +58,7 @@ func main() {
log.Fatal(err)
}
monday := now.With(time.Now()).Monday().AddDate(0, 0, -10)
monday := now.With(time.Now()).Monday().AddDate(0, 0, -7)
items = filterEntriesAfter(items, monday)
summary := getSummary(monday, items)
@ -85,7 +84,6 @@ func getSummary(monday time.Time, items []microsub.Item) Summary {
}
summary := Summary{
Name: fmt.Sprintf("Digest for Week %d-%d", week, year),
Published: monday.AddDate(0, 0, 7).Format("2 Jan 2006"),
Items: items,
Grouped: grouped,
}

View File

@ -9,6 +9,14 @@
{{ range .LikeOf }}
<li><a href="{{ . }}">{{ . }}</a></li>
{{ end }}
{{ else if eq $k "repost-of" }}
{{ range .RepostOf }}
<li><a href="{{ . }}">{{ . }}</a></li>
{{ end }}
{{ else if eq $k "in-reply-to" }}
{{ range .InReplyTo }}
<li><a href="{{ . }}">{{ . }}</a></li>
{{ end }}
{{ else }}
{{ if .Checkin }}
<li><a href="{{ .URL }}">Checkin at {{ .Checkin.Name }} in {{ .Checkin.Locality }}, {{ .Checkin.Region }}</a></li>