Cleanup and show just a week
This commit is contained in:
parent
3f06fd8aad
commit
745da46fb6
4
main.go
4
main.go
|
@ -23,7 +23,6 @@ import (
|
||||||
type Summary struct {
|
type Summary struct {
|
||||||
PostTypes map[string]string
|
PostTypes map[string]string
|
||||||
Name string
|
Name string
|
||||||
Published string
|
|
||||||
Items []microsub.Item
|
Items []microsub.Item
|
||||||
Grouped map[string][]microsub.Item
|
Grouped map[string][]microsub.Item
|
||||||
}
|
}
|
||||||
|
@ -59,7 +58,7 @@ func main() {
|
||||||
log.Fatal(err)
|
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)
|
items = filterEntriesAfter(items, monday)
|
||||||
|
|
||||||
summary := getSummary(monday, items)
|
summary := getSummary(monday, items)
|
||||||
|
@ -85,7 +84,6 @@ func getSummary(monday time.Time, items []microsub.Item) Summary {
|
||||||
}
|
}
|
||||||
summary := Summary{
|
summary := Summary{
|
||||||
Name: fmt.Sprintf("Digest for Week %d-%d", week, year),
|
Name: fmt.Sprintf("Digest for Week %d-%d", week, year),
|
||||||
Published: monday.AddDate(0, 0, 7).Format("2 Jan 2006"),
|
|
||||||
Items: items,
|
Items: items,
|
||||||
Grouped: grouped,
|
Grouped: grouped,
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,6 +9,14 @@
|
||||||
{{ range .LikeOf }}
|
{{ range .LikeOf }}
|
||||||
<li><a href="{{ . }}">{{ . }}</a></li>
|
<li><a href="{{ . }}">{{ . }}</a></li>
|
||||||
{{ end }}
|
{{ 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 }}
|
{{ else }}
|
||||||
{{ if .Checkin }}
|
{{ if .Checkin }}
|
||||||
<li><a href="{{ .URL }}">Checkin at {{ .Checkin.Name }} in {{ .Checkin.Locality }}, {{ .Checkin.Region }}</a></li>
|
<li><a href="{{ .URL }}">Checkin at {{ .Checkin.Name }} in {{ .Checkin.Locality }}, {{ .Checkin.Region }}</a></li>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user