From 6dd2a3278086d08d5fcd4834634260157f7092cd Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Fri, 24 May 2024 19:15:18 -0500 Subject: [PATCH] Add Unwind URL --- src/hmnurl/hmnurl_test.go | 4 ---- src/hmnurl/urls.go | 13 ++++++------- src/website/landing.go | 2 -- src/website/routes.go | 4 ++++ 4 files changed, 10 insertions(+), 13 deletions(-) diff --git a/src/hmnurl/hmnurl_test.go b/src/hmnurl/hmnurl_test.go index 047a53ce..73b5ec7d 100644 --- a/src/hmnurl/hmnurl_test.go +++ b/src/hmnurl/hmnurl_test.go @@ -44,10 +44,6 @@ func TestShowcase(t *testing.T) { AssertRegexMatch(t, BuildShowcase(), RegexShowcase, nil) } -func TestStreams(t *testing.T) { - AssertRegexMatch(t, BuildStreams(), RegexStreams, nil) -} - func TestWhenIsIt(t *testing.T) { AssertRegexMatch(t, BuildWhenIsIt(), RegexWhenIsIt, nil) } diff --git a/src/hmnurl/urls.go b/src/hmnurl/urls.go index 24ce8623..c83eb18d 100644 --- a/src/hmnurl/urls.go +++ b/src/hmnurl/urls.go @@ -35,13 +35,6 @@ func BuildShowcase() string { return Url("/showcase", nil) } -var RegexStreams = regexp.MustCompile("^/streams$") - -func BuildStreams() string { - defer CatchPanic() - return Url("/streams", nil) -} - var RegexWhenIsIt = regexp.MustCompile("^/whenisit$") func BuildWhenIsIt() string { @@ -1047,6 +1040,12 @@ func BuildUserFile(filepath string) string { return BuildPublic(fmt.Sprintf("media/%s", filepath), false) } +/* +* Redirects + */ + +var RegexUnwind = regexp.MustCompile(`^/unwind$`) + /* * Other */ diff --git a/src/website/landing.go b/src/website/landing.go index e4ee720f..391fe204 100644 --- a/src/website/landing.go +++ b/src/website/landing.go @@ -24,7 +24,6 @@ type LandingTemplateData struct { ManifestoUrl string FeedUrl string PodcastUrl string - StreamsUrl string ShowcaseUrl string AtomFeedUrl string MarkAllReadUrl string @@ -151,7 +150,6 @@ func Index(c *RequestContext) ResponseData { ManifestoUrl: hmnurl.BuildManifesto(), FeedUrl: hmnurl.BuildFeed(), PodcastUrl: hmnurl.BuildPodcast(), - StreamsUrl: hmnurl.BuildStreams(), ShowcaseUrl: hmnurl.BuildShowcase(), AtomFeedUrl: hmnurl.BuildAtomFeed(), MarkAllReadUrl: hmnurl.HMNProjectContext.BuildForumMarkRead(0), diff --git a/src/website/routes.go b/src/website/routes.go index 354a8691..0e878884 100644 --- a/src/website/routes.go +++ b/src/website/routes.go @@ -164,6 +164,10 @@ func NewWebsiteRoutes(conn *pgxpool.Pool) http.Handler { return c.Redirect(hmnurl.BuildEducationIndex(), http.StatusFound) }) + hmnOnly.GET(hmnurl.RegexUnwind, func(c *RequestContext) ResponseData { + return c.Redirect("https://www.youtube.com/playlist?list=PL-IPpPzBYXBGsAd9-c2__x6LJG4Zszs0T", http.StatusFound) + }) + // Project routes can appear either at the root (e.g. hero.handmade.network/edit) // or on a personal project path (e.g. handmade.network/p/123/hero/edit). So, we // have pulled all those routes into this function.