diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-04-13 18:03:13 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2024-04-13 18:03:13 -0600 |
commit | 169e980f56e1e1b4d1ba80e29cd11d73afad2f96 (patch) | |
tree | ba2a5129c9e77ed6bc9b1c305b049dea2d999b41 | |
parent | 62157f024f000a60824b45863dec54a0b49f13c3 (diff) |
looking decent
-rw-r--r-- | cmd/generate/imworkingon.html.tmpl | 9 | ||||
-rw-r--r-- | cmd/generate/main.go | 6 | ||||
-rw-r--r-- | cmd/generate/src_contribs.go | 5 | ||||
-rw-r--r-- | cmd/generate/src_upstreams.go | 2 |
4 files changed, 18 insertions, 4 deletions
diff --git a/cmd/generate/imworkingon.html.tmpl b/cmd/generate/imworkingon.html.tmpl index e0ee5a5..20756ae 100644 --- a/cmd/generate/imworkingon.html.tmpl +++ b/cmd/generate/imworkingon.html.tmpl @@ -63,7 +63,7 @@ grid-template-areas: "uname url url url" "uname tag tag tag" - "uname submitted status ." + "uname submitted updated status" "udesc desc desc desc"; padding: 0; overflow: hidden; @@ -102,6 +102,12 @@ border-top: solid 1px #8D8DA6; border-right: solid 1px #8D8DA6; } + article.contrib div.contrib-updated { + grid-area: updated; + background-color: #DDDDFF; + border-top: solid 1px #8D8DA6; + border-right: solid 1px #8D8DA6; + } article.contrib div.contrib-status { grid-area: status; background-color: #DDDDFF; @@ -143,6 +149,7 @@ {{- end }} </div> <div class="contrib-submitted">Submitted: {{ $contrib.SubmittedAt.Format "2006-01-02" }}</div> + <div class="contrib-updated">{{ if not $contrib.LastUpdatedAt.IsZero }}Last updated: {{ $contrib.LastUpdatedAt.Format "2006-01-02" }}{{ end }}</div> <div class="contrib-status">Status: {{ $contrib.Status }}</div> <div class="contrib-desc">{{ $contrib.Desc | md2html }}</div> </article> diff --git a/cmd/generate/main.go b/cmd/generate/main.go index cee0f2e..85f452e 100644 --- a/cmd/generate/main.go +++ b/cmd/generate/main.go @@ -5,6 +5,7 @@ import ( _ "embed" "fmt" "os" + "sort" "strings" "html/template" @@ -47,6 +48,11 @@ func mainWithError() error { if err != nil { return err } + + sort.Slice(contribs, func(i, j int) bool { + return contribs[i].SubmittedAt.After(contribs[j].SubmittedAt) + }) + tmpl := template.Must(template.New("imworkingon.html"). Funcs(template.FuncMap{ "md2html": MarkdownToHTML, diff --git a/cmd/generate/src_contribs.go b/cmd/generate/src_contribs.go index b08e18d..4cbaa4f 100644 --- a/cmd/generate/src_contribs.go +++ b/cmd/generate/src_contribs.go @@ -17,8 +17,9 @@ type Contribution struct { SponsoredBy string `json:"sponsored-by"` Desc string `json:"desc"` - SubmittedAt time.Time `json:"submitted-at"` - Status string `json:"status"` + SubmittedAt time.Time `json:"submitted-at"` + LastUpdatedAt time.Time `json:"last-updated-at"` + Status string `json:"status"` } func ReadContribs(filename string) ([]Contribution, error) { diff --git a/cmd/generate/src_upstreams.go b/cmd/generate/src_upstreams.go index d35711c..03f72ec 100644 --- a/cmd/generate/src_upstreams.go +++ b/cmd/generate/src_upstreams.go @@ -42,7 +42,7 @@ func (upstream *Upstream) Fill() error { if err != nil { return err } - _, upstream.Name = strings.TrimSuffix(path.Split(path.Clean(u.Path)), ".git") + _, upstream.Name = path.Split(strings.TrimSuffix(path.Clean(u.Path), ".git")) } return nil } |