package components import "strings" import "slices" import "cmp" type Project struct { Name string Summary string Image templ.SafeURL Link templ.SafeURL Icon string WIP bool Current bool Language string } func SortProjects(projects []Project) []Project { slices.SortFunc(projects, func(a, b Project) int { if (a.Current && !b.Current) || (a.WIP && !b.WIP) { return -1 } return cmp.Compare(a.Name, b.Name) }) return projects } templ ProjectCard(project Project) {

{ project.Name }

if project.Current { Current } if project.WIP { WIP }

{ project.Summary }

}