hmn/src/website/urls.go

17 lines
434 B
Go
Raw Normal View History

package website
import (
"git.handmade.network/hmn/hmn/src/hmnurl"
"git.handmade.network/hmn/hmn/src/models"
)
func BuildProjectRootResourceUrl(projectSlug string, kind models.ThreadType) string {
2021-05-11 22:53:23 +00:00
switch kind {
case models.ThreadTypeProjectBlogPost:
2021-05-11 22:53:23 +00:00
return hmnurl.BuildBlog(projectSlug, 1)
case models.ThreadTypeForumPost:
return hmnurl.BuildForum(projectSlug, nil, 1)
}
2021-05-11 22:53:23 +00:00
return hmnurl.BuildProjectHomepage(projectSlug)
}