Handmade
diff --git a/src/templates/templates.go b/src/templates/templates.go
index d82e2b21..f17e52e4 100644
--- a/src/templates/templates.go
+++ b/src/templates/templates.go
@@ -287,6 +287,12 @@ var HMNTemplateFuncs = template.FuncMap{
"trim": func(str template.HTML) template.HTML {
return template.HTML(strings.TrimSpace(string(str)))
},
+ "lastidx": func(idx int, l int) bool {
+ return idx == l-1
+ },
+ "isodd": func(num int) bool {
+ return num%2 == 1
+ },
// NOTE(asaf): Template specific functions:
"projectcarddata": func(project Project, classes string) ProjectCardData {
diff --git a/src/website/jam.go b/src/website/jam.go
index 0d8fa6fe..44f94570 100644
--- a/src/website/jam.go
+++ b/src/website/jam.go
@@ -144,6 +144,7 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
ProjectSubmissionUrl string
SubmittedProjectUrl string
+ Projects []templates.Project
TimelineItems []templates.TimelineItem
}
@@ -194,6 +195,13 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
}
}
+ projects := make([]templates.Project, 0, len(jamProjects))
+ for _, jp := range jamProjects {
+ urlContext := hmndata.UrlContextForProject(&jp.Project)
+ projectUrl := urlContext.BuildHomepage()
+ projects = append(projects, templates.ProjectAndStuffToTemplate(&jp, projectUrl, c.Theme))
+ }
+
tmpl := JamFeedData{
BaseData: baseData,
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
@@ -202,6 +210,7 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
TwitchEmbedUrl: twitchEmbedUrl,
ProjectSubmissionUrl: hmnurl.BuildProjectNewJam(),
SubmittedProjectUrl: "",
+ Projects: projects,
TimelineItems: timelineItems,
}