From 888c11cebe88008a1fdf64f7a10b010237ad1411 Mon Sep 17 00:00:00 2001 From: "Luke T. Shumaker" Date: Mon, 29 Apr 2024 15:10:23 -0600 Subject: imworkingon: DRY --- cmd/generate/imworkingon.html.tmpl | 36 ++++++++++-------------------------- 1 file changed, 10 insertions(+), 26 deletions(-) (limited to 'cmd/generate/imworkingon.html.tmpl') diff --git a/cmd/generate/imworkingon.html.tmpl b/cmd/generate/imworkingon.html.tmpl index 43c5173..c1ea442 100644 --- a/cmd/generate/imworkingon.html.tmpl +++ b/cmd/generate/imworkingon.html.tmpl @@ -34,10 +34,8 @@ {{- end }} -
-

In-progress work 🔗

- {{- range $contrib := .Contribs }} - {{- if or (eq $contrib.StatusClass "merged") (eq $contrib.StatusClass "released") }}{{ continue }}{{ end }} +{{- define "contrib" }} + {{ $contrib := . }} {{ $upstream := $contrib | getUpstream }}
@@ -60,34 +58,20 @@ {{- if $contrib.SponsoredBy }}

Sponsored-by: {{ $contrib.SponsoredBy }}

{{ end -}}
+{{- end }} + +
+

In-progress work 🔗

+ {{- range $contrib := .Contribs }} + {{- if or (eq $contrib.StatusClass "merged") (eq $contrib.StatusClass "released") }}{{ continue }}{{ end }} + {{ template "contrib" $contrib }} {{- end }}

Completed work 🔗

{{- range $contrib := .Contribs }} {{- if or (eq $contrib.StatusClass "merged") (eq $contrib.StatusClass "released") | not }}{{ continue }}{{ end }} - {{ $upstream := $contrib | getUpstream }} -
- -
{{ $upstream.Desc | md2html }}
-
- {{- range $url := $contrib.URLs }} - {{ $url }}
- {{- end }} -
-
- {{- range $tag := $contrib.Tags }} - #{{ $tag }} {{/* */}} - {{- end }} -
- -
{{ if not $contrib.LastUpdatedAt.IsZero }}Last updated: {{ timeTag $contrib.LastUpdatedAt "2006-01-02" }}{{ end }}
-
Status: {{ $contrib.Status }}
-
- {{- $contrib.Desc | md2html }} - {{- if $contrib.SponsoredBy }}

Sponsored-by: {{ $contrib.SponsoredBy }}

{{ end -}} -
-
+ {{ template "contrib" $contrib }} {{- end }}
-- cgit v1.2.3-2-g168b