From 084b13ae347d9bffea7f2be033f941acdb143b04 Mon Sep 17 00:00:00 2001 From: Ben Visness Date: Sat, 5 Nov 2022 16:23:12 -0500 Subject: [PATCH] ...including the nav and stuff --- src/hmnurl/urls.go | 9 +-------- src/templates/src/include/header.html | 5 +---- src/templates/src/library_not_ported_yet.html | 8 -------- src/templates/types.go | 1 - src/website/base_data.go | 4 ++-- src/website/library.go | 9 --------- src/website/routes.go | 7 +++---- 7 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 src/templates/src/library_not_ported_yet.html delete mode 100644 src/website/library.go diff --git a/src/hmnurl/urls.go b/src/hmnurl/urls.go index 8708468..8ee16af 100644 --- a/src/hmnurl/urls.go +++ b/src/hmnurl/urls.go @@ -701,18 +701,11 @@ func (c *UrlContext) BuildBlogPostReply(threadId int, postId int) string { } /* -* Library +* Library (old) */ var RegexLibraryAny = regexp.MustCompile(`^/library`) -var RegexLibrary = regexp.MustCompile(`^/library$`) - -func BuildLibrary() string { - defer CatchPanic() - return Url("/library", nil) -} - /* * Episode Guide */ diff --git a/src/templates/src/include/header.html b/src/templates/src/include/header.html index 261f3a5..6130f33 100644 --- a/src/templates/src/include/header.html +++ b/src/templates/src/include/header.html @@ -84,10 +84,7 @@
Resources
{{ svg "chevron-down-thick" }}
diff --git a/src/templates/src/library_not_ported_yet.html b/src/templates/src/library_not_ported_yet.html deleted file mode 100644 index c6a246c..0000000 --- a/src/templates/src/library_not_ported_yet.html +++ /dev/null @@ -1,8 +0,0 @@ -{{ template "base.html" . }} - -{{ define "content" }} -
-

The library is coming back soon.

-

The previous library wasn't everything we wanted it to be. Watch this space.

-
-{{ end }} diff --git a/src/templates/types.go b/src/templates/types.go index d6c2f7d..8810e10 100644 --- a/src/templates/types.go +++ b/src/templates/types.go @@ -52,7 +52,6 @@ type Header struct { FishbowlUrl string ForumsUrl string ConferencesUrl string - LibraryUrl string EducationUrl string Project *ProjectHeader diff --git a/src/website/base_data.go b/src/website/base_data.go index c9ec89d..1c0e607 100644 --- a/src/website/base_data.go +++ b/src/website/base_data.go @@ -12,7 +12,8 @@ func getBaseDataAutocrumb(c *RequestContext, title string) templates.BaseData { } // NOTE(asaf): If you set breadcrumbs, the breadcrumb for the current project will automatically be prepended when necessary. -// If you pass nil, no breadcrumbs will be created. +// +// If you pass nil, no breadcrumbs will be created. func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadcrumb) templates.BaseData { var project models.Project if c.CurrentProject != nil { @@ -75,7 +76,6 @@ func getBaseData(c *RequestContext, title string, breadcrumbs []templates.Breadc FishbowlUrl: hmnurl.BuildFishbowlIndex(), ForumsUrl: hmnurl.HMNProjectContext.BuildForum(nil, 1), ConferencesUrl: hmnurl.BuildConferences(), - LibraryUrl: hmnurl.BuildLibrary(), EducationUrl: hmnurl.BuildEducationIndex(), }, Footer: templates.Footer{ diff --git a/src/website/library.go b/src/website/library.go deleted file mode 100644 index 17d58c8..0000000 --- a/src/website/library.go +++ /dev/null @@ -1,9 +0,0 @@ -package website - -func LibraryNotPortedYet(c *RequestContext) ResponseData { - baseData := getBaseData(c, "Library", nil) - - var res ResponseData - res.MustWriteTemplate("library_not_ported_yet.html", baseData, c.Perf) - return res -} diff --git a/src/website/routes.go b/src/website/routes.go index 55e2121..028d988 100644 --- a/src/website/routes.go +++ b/src/website/routes.go @@ -130,10 +130,9 @@ func NewWebsiteRoutes(conn *pgxpool.Pool) http.Handler { hmnOnly.POST(hmnurl.RegexAPICheckUsername, csrfMiddleware(APICheckUsername)) - hmnOnly.GET(hmnurl.RegexLibraryAny, LibraryNotPortedYet) - // hmnOnly.GET(hmnurl.RegexLibraryAny, func(c *RequestContext) ResponseData { - // return c.Redirect(hmnurl.BuildEducationIndex(), http.StatusFound) - // }) + hmnOnly.GET(hmnurl.RegexLibraryAny, func(c *RequestContext) ResponseData { + return c.Redirect(hmnurl.BuildEducationIndex(), 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