Add Unwind URL

This commit is contained in:
Ben Visness 2024-05-24 19:15:18 -05:00
parent b681bacc16
commit 6dd2a32780
4 changed files with 10 additions and 13 deletions

View File

@ -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)
}

View File

@ -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
*/

View File

@ -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),

View File

@ -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.