heaaaghghghghg jam time yayaya

This commit is contained in:
Ben Visness 2024-03-12 23:20:35 -05:00
parent ee491c7696
commit 5dd4880d4c
14 changed files with 267 additions and 184 deletions

View File

@ -140,6 +140,13 @@ func BuildJamFeed2024_Learning() string {
return Url("/jam/learning-2024/feed", nil)
}
var RegexJamGuidelines2024_Learning = regexp.MustCompile("^/jam/learning-2024/guidelines$")
func BuildJamGuidelines2024_Learning() string {
defer CatchPanic()
return Url("/jam/learning-2024/guidelines", nil)
}
func BuildJamIndexAny(slug string) string {
defer CatchPanic()
return Url(fmt.Sprintf("/jam/%s", slug), nil)

View File

@ -0,0 +1,23 @@
<div class="mw7 margin-center link--white">
<div class="flex flex-column pv4 tc">
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns">
<a class="jam-title db mb3" href="{{ .JamUrl }}">Learning Jam</a>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
{{ if gt .DaysUntilEnd 0 }}
<div class="flex g3 justify-center mt4">
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
{{ end }}
</div>
</div>

View File

@ -0,0 +1,19 @@
<div class="mw7 margin-center link--white">
<div class="flex flex-column flex-row-ns justify-center items-center pv4 g3 tc tl-ns">
<img class="jam-logo-small" src="{{ static "learningjam2024/logo.svg" }}">
<div class="flex flex-column justify-between">
<div>
<a class="jam-title db small" href="{{ .JamUrl }}">Learning Jam</a>
<div class="fw6 f5 mb3">March 15 - 24, 2024</div>
</div>
<div class="flex items-center g2">
{{ if and (not .SubmittedProjectUrl) (gt .DaysUntilEnd 0) }}
<a href="{{ .NewProjectUrl }}" class="btn--jam">Create your project</a>
{{ else }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
{{ end }}
<a href="{{ .GuidelinesUrl }}" class="flex items-baseline pa2">Guidelines <div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div></a>
</div>
</div>
</div>
</div>

View File

@ -2,10 +2,13 @@
<h2 class="dib c--theme-gradient-light">What is a Learning Jam?</h2>
<div class="post-content">
<p>
The <b class="c--theme-gradient-light">Learning Jam</b> is a cool good time.
The <b class="c--theme-gradient-light">Learning Jam</b> is an opportunity for you to learn something new.
</p>
<p>
TODO
Unlike traditional game jams, and unlike our previous programming jams, the goal of the <b class="c--theme-gradient-light">Learning Jam</b> is <em>knowledge</em>. It's an opportunity to throw yourself at a topic and learn everything you can about it—and then, to turn around and share that knowledge with others.
</p>
<p>
The jam takes place over <b>two weekends</b>. On the first weekend, you'll learn as much as you can about your topic of choice. On the second, you'll share what you learned in whatever form you like—writeup, video, Minecraft mod, whatever.
</p>
</div>
</div>

View File

@ -2,8 +2,8 @@
<div class="flex flex-column g3 bg--rich-gray pa3">
<div class="flex flex-row g3 items-start">
{{ if .OwnerAvatarUrl }}
<a class="flex flex-shrink-0 br-100 square items-center justify-center overflow-hidden bg--gray" href="{{ .OwnerUrl }}">
<img class="w2-5" src="{{ .OwnerAvatarUrl }}" />
<a class="flex flex-shrink-0 br-100 square items-center justify-center overflow-hidden" href="{{ .OwnerUrl }}">
<img class="user-avatar w2-5" src="{{ .OwnerAvatarUrl }}" />
</a>
{{ end }}
<div class="flex flex-column">

View File

@ -51,7 +51,7 @@
<div class="post-content">
<h3 class="f4">Mar 15-17: Learn!</h3>
<p>
{{ if eq .DaysUntilStart 0 }}
{{ if and (eq .DaysUntilStart 0) (not .SubmittedProjectUrl) }}
<a href="{{ .NewProjectUrl }}">Create a Handmade Network project</a>
{{ else }}
Create a Handmade Network project

View File

@ -1,18 +1,29 @@
{{ if .Projects }}
<div class="flex flex-row flex-wrap g2">
<div class="flex flex-row flex-wrap g2 link--white">
{{ range .Projects }}
<div class="flex-basis-40-ns flex-grow-1 flex-shrink-1 bg--rich-gray pa3 flex flex-column g1">
<div class="f3">
<a href="{{ .Url }}" class="fw6">{{ .Name }}</a>
{{ if gt (len .Owners) 1 }}
<div class="flex g2">
{{ range .Owners }}
<a href="{{ .ProfileUrl }}" class="flex">
<img src="{{ .AvatarUrl }}" class="user-avatar w2">
</a>
{{ end }}
</div>
{{ else }}
{{ range .Owners }}
<a href="{{ .ProfileUrl }}" class="fw6 link--white flex g2 items-center">
<img src="{{ .AvatarUrl }}" class="user-avatar w2">
<div>
{{ .Name }}
</div>
</a>
{{ end }}
{{ end }}
<div class="f3 mt2">
<a href="{{ .Url }}" class="fw6 db">{{ .Name }}</a>
</div>
<div class="flex-grow-1">{{ .Blurb }}</div>
<div class="f7">
by
{{ $owners := .Owners }}
{{ range $idx, $owner := .Owners }}
<a href="{{ $owner.ProfileUrl }}" class="fw6 link--white">{{ $owner.Name }}</a>{{ if not (lastidx $idx (len $owners)) }},{{ end }}
{{ end }}
</div>
</div>
{{ end }}
{{ if isodd (len .Projects) }}

View File

@ -1,46 +1,22 @@
{{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }}
<div class="mw7 margin-center">
<div class="flex flex-column pv4 tc">
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns mb4">
<div class="jam-title mb3">Learning Jam</div>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
<div class="flex g3 justify-center link--white">
{{ if and (eq .DaysUntilStart 0) (gt .DaysUntilEnd 0) }}
{{ if .SubmittedProjectUrl }}
<a class="btn--jam" href="{{ .SubmittedProjectUrl }}">Share your progress</a>
{{ else }}
<a class="btn--jam" href="{{ .ProjectSubmissionUrl }}">Create your project</a>
{{ end }}
{{ end }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
</div>
</div>
{{ template "jam_2024_lj_bannersmall.html" . }}
{{ end }}
{{ define "content" }}
<div class="mw7 margin-center flex flex-column">
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Projects</h2>
<h2 class="c--theme-gradient-light mb3">Projects</h2>
{{ template "jam_2024_lj_projects.html" .Projects }}
</div>
{{ if .TimelineItems }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Recent Updates</h2>
<div class="flex flex-column g2">
<h2 class="c--theme-gradient-light">All updates</h2>
<p>
See what community members are learning about their topics. You can share your own updates via your <a href="{{ or .SubmittedProjectUrl .NewProjectUrl }}">project page</a> or using the <b>!til</b> command on Discord.
</p>
<div class="flex flex-column g2 mt3">
{{ template "jam_2024_lj_feeditems.html" .TimelineItems }}
</div>
</div>

View File

@ -0,0 +1,16 @@
{{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }}
{{ template "jam_2024_lj_bannersmall.html" . }}
{{ end }}
{{ define "content" }}
<div class="mw7 margin-center flex flex-column">
{{ template "jam_2024_lj_guidelines.html" . }}
<div>
<div class="mv5 h3 fill-current link--white">
<a href="{{ .Header.HMNHomepageUrl }}">{{ svg "hmn_circuit" }}</a>
</div>
</div>
</div>
{{ end }}

View File

@ -1,39 +1,11 @@
{{ template "jam_2024_learning_base.html" . }}
{{ define "content-top" }}
<div class="mw7 margin-center">
<div class="flex flex-column pv4 tc">
<img class="jam-logo margin-center" src="{{ static "learningjam2024/logo.svg" }}">
<div class="margin-center mt3 mt4-ns mb4">
<div class="jam-title mb3">Learning Jam</div>
<div class="flex flex-column flex-row-ns justify-between lh-solid g3 g0-ns">
<div>
<div class="fw7 f3 mb1">Learn</div>
<div class="fw3 f4">March 15-17, 2024</div>
</div>
<div>
<div class="fw7 f3 mb1">Share</div>
<div class="fw3 f4">March 22-24, 2024</div>
</div>
</div>
</div>
<div class="flex g3 justify-center link--white">
{{ if eq .DaysUntilStart 0 }}
{{ if gt .DaysUntilEnd 0 }}
{{ if .SubmittedProjectUrl }}
<a class="btn--jam" href="{{ .SubmittedProjectUrl }}">Share your progress</a>
{{ else }}
<a class="btn--jam" href="{{ .NewProjectUrl }}">Create your project</a>
{{ end }}
<a class="btn--jam" href="{{ .JamFeedUrl }}">Recent activity</a>
{{ else }}
<a class="btn--jam" href="{{ .JamFeedUrl }}">See the results</a>
{{ end }}
{{ end }}
<a href="{{ .DiscordInviteUrl }}" class="btn--jam">Join the Discord</a>
</div>
</div>
</div>
{{ if or (gt .DaysUntilStart 0) (eq .DaysUntilEnd 0) }}
{{ template "jam_2024_lj_bannerbig.html" . }}
{{ else }}
{{ template "jam_2024_lj_bannersmall.html" . }}
{{ end }}
{{ end }}
{{ define "content" }}
@ -63,14 +35,20 @@
{{ template "jam_2024_lj_description.html" . }}
{{ if .TimelineItems }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Recent Updates</h2>
<div class="flex flex-column g2">
<h2 class="c--theme-gradient-light">Recent updates</h2>
<p>
See what community members are learning about their topics. You can share your own updates via your <a href="{{ or .SubmittedProjectUrl .NewProjectUrl }}">project page</a> or using the <b>!til</b> command on Discord.
</p>
<div class="flex flex-column g2 mt3">
{{ template "jam_2024_lj_feeditems.html" .TimelineItems }}
<a href="{{ .JamFeedUrl }}" class="link--white tc pa1">
See all updates<div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div>
</a>
</div>
</div>
{{ end }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Projects</h2>
<h2 class="c--theme-gradient-light mb3">Projects</h2>
{{ template "jam_2024_lj_projects.html" .Projects }}
</div>
{{ else }}
@ -82,7 +60,7 @@
{{ template "jam_2024_lj_description.html" . }}
{{ with .TwitchEmbedUrl }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="dib c--theme-gradient-light">Recap Show</h2>
<h2 class="dib c--theme-gradient-light">Recap show</h2>
<p>
Watch the livestream celebrating all the submissions:
</p>
@ -92,7 +70,14 @@
</div>
{{ end }}
<div class="ph3 pv4 bb b--rich-gray">
<h2 class="c--theme-gradient-light">Projects</h2>
{{ template "jam_2024_lj_projects.html" .Projects }}
<div class="flex justify-between items-baseline">
<h2 class="c--theme-gradient-light mb0">Submitted projects</h2>
<a href="{{ .JamFeedUrl }}" class="link--white tc">
See all updates<div class="dib svgicon f8 ml1">{{ svg "chevron-right" }}</div>
</a>
</div>
<div class="mt3">
{{ template "jam_2024_lj_projects.html" .Projects }}
</div>
</div>
{{ end }}

View File

@ -55,7 +55,7 @@
--spacing-7: 16rem;
--border-radius-2: 0.25rem;
--link-color: #8Bd5FF;
--link-color: transparent;
}
body {
@ -115,10 +115,13 @@
color: transparent;
}
.c--theme-gradient-light {
a, .c--theme-gradient-light {
background: var(--theme-gradient-light);
background-clip: text;
-webkit-background-clip: text;
}
.c--theme-gradient-light {
color: transparent;
}
@ -134,6 +137,10 @@
background-color: var(--bg-button);
}
.btn--jam.small {
padding: var(--spacing-1) var(--spacing-2);
}
.btn--jam:hover {
background-color: var(--bg-button-hover);
}
@ -187,16 +194,23 @@
padding-right: 0.6rem;
}
.user-avatar-header {
width: 1.8rem;
.user-avatar {
border-radius: 999px;
background-color: rgba(0, 0, 0, 0.4);
}
.user-avatar.header {
width: 1.8rem;
}
.jam-logo {
max-width: 18rem;
}
.jam-logo-small {
max-width: 8rem;
}
.jam-title {
/* align with the width of the logo */
font-size: 2.76rem;
@ -208,6 +222,15 @@
margin-right: -0.03em;
}
.jam-title.small {
font-size: 2.25rem;
/* align with the text's actual bounding box */
line-height: 1.18;
margin-top: -0.18em;
margin-left: -0.03em;
margin-right: -0.03em;
}
/* not small */
@media screen and (min-width: 35em) {
.jam-logo {
@ -241,7 +264,7 @@
<a href="{{ .Header.ProjectIndexUrl }}">Projects</a>
<a href="{{ .Header.JamsUrl }}">Jams</a>
<a class="db" href="{{ or .Header.UserProfileUrl .LoginPageUrl }}">
<img class="user-avatar-header" src="{{ .UserAvatarUrl }}">
<img class="user-avatar header" src="{{ .UserAvatarUrl }}">
</a>
</div>
</div>

View File

@ -132,6 +132,8 @@
2023 Wheel Reinvention Jam
{{- else if eq . "visibility-2023" -}}
2023 Visibility Jam
{{- else if eq . "learning-2024" -}}
2024 Learning Jam
{{- else -}}
???
{{- end -}}

View File

@ -46,32 +46,12 @@ func JamsIndex(c *RequestContext) ResponseData {
func JamIndex2024_Learning(c *RequestContext) ResponseData {
var res ResponseData
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime)
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = []templates.OpenGraphItem{
{Property: "og:title", Value: "Learning Jam"},
{Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"},
{Property: "og:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJOpenGraph.png", true)},
{Property: "og:description", Value: "A two-weekend jam where you dive deep into a topic, then share it with the rest of the community."},
{Property: "og:url", Value: hmnurl.BuildJamIndex2024_Learning()},
{Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)},
}
baseData.OpenGraphItems = opengraphLJ2024
type JamPageData struct {
templates.BaseData
UserAvatarUrl string
DaysUntilStart, DaysUntilEnd int
TwitchEmbedUrl string
NewProjectUrl string
SubmittedProjectUrl string
JamFeedUrl string
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
feedData, err := getLJ2024FeedData(c, 5)
@ -79,65 +59,35 @@ func JamIndex2024_Learning(c *RequestContext) ResponseData {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
type JamPageData struct {
templates.BaseData
JamBaseDataLJ2024
TwitchEmbedUrl string
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
}
tmpl := JamPageData{
BaseData: baseData,
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
DaysUntilStart: daysUntilStart,
DaysUntilEnd: daysUntilEnd,
TwitchEmbedUrl: getTwitchEmbedUrl(c),
NewProjectUrl: hmnurl.BuildProjectNewJam(),
SubmittedProjectUrl: "",
JamFeedUrl: hmnurl.BuildJamFeed2024_Learning(),
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
TwitchEmbedUrl: getTwitchEmbedUrl(c),
Projects: feedData.Projects,
TimelineItems: feedData.TimelineItems,
}
if c.CurrentUser != nil {
tmpl.UserAvatarUrl = templates.UserAvatarUrl(c.CurrentUser, "dark")
projects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{
OwnerIDs: []int{c.CurrentUser.ID},
JamSlugs: []string{hmndata.LJ2024.Slug},
Limit: 1,
})
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch jam projects for current user"))
}
if len(projects) > 0 {
urlContext := hmndata.UrlContextForProject(&projects[0].Project)
tmpl.SubmittedProjectUrl = urlContext.BuildHomepage()
}
}
res.MustWriteTemplate("jam_2024_lj_index.html", tmpl, c.Perf)
return res
}
func JamFeed2024_Learning(c *RequestContext) ResponseData {
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime)
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = []templates.OpenGraphItem{
{Property: "og:title", Value: "Learning Jam"},
{Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"},
{Property: "og:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJOpenGraph.png", true)},
{Property: "og:description", Value: "A two-weekend jam where you dive deep into a topic, then teach it to the rest of the community."},
{Property: "og:url", Value: hmnurl.BuildJamFeed2024_Learning()},
{Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)},
}
baseData.OpenGraphItems = opengraphLJ2024
type JamFeedData struct {
templates.BaseData
UserAvatarUrl string
DaysUntilStart, DaysUntilEnd int
ProjectSubmissionUrl string
SubmittedProjectUrl string
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
feedData, err := getLJ2024FeedData(c, 0)
@ -145,31 +95,20 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
tmpl := JamFeedData{
BaseData: baseData,
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
DaysUntilStart: daysUntilStart,
DaysUntilEnd: daysUntilEnd,
ProjectSubmissionUrl: hmnurl.BuildProjectNewJam(),
SubmittedProjectUrl: "",
Projects: feedData.Projects,
TimelineItems: feedData.TimelineItems,
type JamFeedData struct {
templates.BaseData
JamBaseDataLJ2024
Projects JamProjectDataLJ2024
TimelineItems []templates.TimelineItem
}
if c.CurrentUser != nil {
tmpl.UserAvatarUrl = templates.UserAvatarUrl(c.CurrentUser, "dark")
projects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{
OwnerIDs: []int{c.CurrentUser.ID},
JamSlugs: []string{hmndata.LJ2024.Slug},
Limit: 1,
})
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, oops.New(err, "failed to fetch jam projects for current user"))
}
if len(projects) > 0 {
urlContext := hmndata.UrlContextForProject(&projects[0].Project)
tmpl.SubmittedProjectUrl = urlContext.BuildHomepage()
}
tmpl := JamFeedData{
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
Projects: feedData.Projects,
TimelineItems: feedData.TimelineItems,
}
var res ResponseData
@ -177,6 +116,51 @@ func JamFeed2024_Learning(c *RequestContext) ResponseData {
return res
}
func JamGuidelines2024_Learning(c *RequestContext) ResponseData {
baseData := getBaseDataAutocrumb(c, hmndata.LJ2024.Name)
baseData.OpenGraphItems = opengraphLJ2024
jamBaseData, err := getLJ2024BaseData(c)
if err != nil {
return c.ErrorResponse(http.StatusInternalServerError, err)
}
type JamGuidelinesData struct {
templates.BaseData
JamBaseDataLJ2024
}
tmpl := JamGuidelinesData{
BaseData: baseData,
JamBaseDataLJ2024: jamBaseData,
}
var res ResponseData
res.MustWriteTemplate("jam_2024_lj_guidelines_index.html", tmpl, c.Perf)
return res
}
var opengraphLJ2024 = []templates.OpenGraphItem{
{Property: "og:title", Value: "Learning Jam"},
{Property: "og:site_name", Value: "Handmade Network"},
{Property: "og:type", Value: "website"},
{Property: "og:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJOpenGraph.png", true)},
{Property: "og:description", Value: "A two-weekend jam where you dive deep into a topic, then share it with the rest of the community."},
{Property: "og:url", Value: hmnurl.BuildJamIndex2024_Learning()},
{Name: "twitter:card", Value: "summary_large_image"},
{Name: "twitter:image", Value: hmnurl.BuildPublic("learningjam2024/2024LJTwitterCard.png", true)},
}
type JamBaseDataLJ2024 struct {
UserAvatarUrl string
DaysUntilStart, DaysUntilEnd int
JamUrl string
JamFeedUrl string
NewProjectUrl string
SubmittedProjectUrl string
GuidelinesUrl string
}
type JamProjectDataLJ2024 struct {
Projects []templates.Project
NewProjectUrl string
@ -189,6 +173,39 @@ type JamFeedDataLJ2024 struct {
projects []hmndata.ProjectAndStuff
}
func getLJ2024BaseData(c *RequestContext) (JamBaseDataLJ2024, error) {
daysUntilStart := daysUntil(hmndata.LJ2024.StartTime)
daysUntilEnd := daysUntil(hmndata.LJ2024.EndTime)
tmpl := JamBaseDataLJ2024{
UserAvatarUrl: templates.UserAvatarDefaultUrl("dark"),
DaysUntilStart: daysUntilStart,
DaysUntilEnd: daysUntilEnd,
JamUrl: hmnurl.BuildJamIndex2024_Learning(),
JamFeedUrl: hmnurl.BuildJamFeed2024_Learning(),
NewProjectUrl: hmnurl.BuildProjectNewJam(),
GuidelinesUrl: hmnurl.BuildJamGuidelines2024_Learning(),
}
if c.CurrentUser != nil {
tmpl.UserAvatarUrl = templates.UserAvatarUrl(c.CurrentUser, "dark")
projects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{
OwnerIDs: []int{c.CurrentUser.ID},
JamSlugs: []string{hmndata.LJ2024.Slug},
Limit: 1,
})
if err != nil {
return JamBaseDataLJ2024{}, oops.New(err, "failed to fetch jam projects for current user")
}
if len(projects) > 0 {
urlContext := hmndata.UrlContextForProject(&projects[0].Project)
tmpl.SubmittedProjectUrl = urlContext.BuildHomepage()
}
}
return tmpl, nil
}
// 0 for no limit on timeline items.
func getLJ2024FeedData(c *RequestContext, maxTimelineItems int) (JamFeedDataLJ2024, error) {
jamProjects, err := hmndata.FetchProjects(c, c.Conn, c.CurrentUser, hmndata.ProjectsQuery{
@ -247,7 +264,7 @@ func getTwitchEmbedUrl(c *RequestContext) string {
FROM twitch_latest_status
WHERE twitch_login = $1
`,
"carlsagan42",
"handmadenetwork",
)
if err != nil {
c.Logger.Warn().Err(err).Msg("failed to query Twitch status for the HMN account")

View File

@ -73,6 +73,7 @@ func NewWebsiteRoutes(conn *pgxpool.Pool) http.Handler {
hmnOnly.GET(hmnurl.RegexJamFeed2023, JamFeed2023)
hmnOnly.GET(hmnurl.RegexJamIndex2024_Learning, JamIndex2024_Learning)
hmnOnly.GET(hmnurl.RegexJamFeed2024_Learning, JamFeed2024_Learning)
hmnOnly.GET(hmnurl.RegexJamGuidelines2024_Learning, JamGuidelines2024_Learning)
hmnOnly.GET(hmnurl.RegexTimeMachine, TimeMachine)
hmnOnly.GET(hmnurl.RegexTimeMachineSubmissions, TimeMachineSubmissions)