From 049af9601fd0ae8b03fe17eb96d49bba98e2d176 Mon Sep 17 00:00:00 2001 From: Peter Sanchez Date: Wed, 10 Jul 2024 07:14:36 -0600 Subject: [PATCH] Adding features to homepage instead of a separate page --- core/routes.go | 139 +++++++++++++++++------------------- helpers.go | 4 +- templates/base.html | 4 +- templates/feature_tour.html | 121 +++++++++++++++++++++++-------- 4 files changed, 160 insertions(+), 108 deletions(-) diff --git a/core/routes.go b/core/routes.go index c4700bc..a7d392d 100644 --- a/core/routes.go +++ b/core/routes.go @@ -51,7 +51,7 @@ type Service struct { // RegisterRoutes ... func (s *Service) RegisterRoutes() { - s.eg.GET("/", s.Homepage).Name = "index" + s.eg.GET("/", s.Homepage).Name = s.RouteName("index") s.eg.GET("/invalid/:d", s.InvalidDomain).Name = s.RouteName("invalid_domain") s.eg.GET("/:slug", s.OrgLinksList).Name = s.RouteName("org_link_list") s.eg.GET("/:slug/rss", s.OrgLinksList).Name = s.RouteName("org_link_list_rss") @@ -260,7 +260,7 @@ func (s *Service) InvalidDomain(c echo.Context) error { return err } if len(domains) == 0 { - // NOTE Should not happens, but just in case + // Should not happen, but just in case return echo.NotFoundHandler(c) } gmap := gobwebs.Map{"pd": pd, "domain": d} @@ -281,59 +281,7 @@ func (s *Service) Homepage(c echo.Context) error { return c.Redirect(http.StatusFound, c.Echo().Reverse(s.RouteName("home_link_list"))) } - lt := localizer.GetSessionLocalizer(c) - pd := localizer.NewPageData( - lt.Translate("Social bookmarking plus link sharing, shortening and listings all in one app."), - ) - pd.Data["line1"] = lt.Translate( - "Welcome to LinkTaco. Where you can mix all your link saving and sharing needs in one " + - "tight little bundle. Much like a taco. A link taco if you will.", - ) - pd.Data["line2"] = lt.Translate( - "OK that's cheesy, I know... get it... cheesy? OK, I'll stop. Everyone knows you don't " + - "actually put cheese in tacos.", - ) - pd.Data["line3"] = lt.Translate("Seriously though...") - pd.Data["line4"] = lt.Translate( - "Social bookmarking is not new, it's just been forgotten. Link shortening with " + - "analytics has been around forever. Link listings became cool once social media " + - "started allowing us to post a link to our websites in our profiles.", - ) - pd.Data["line5"] = lt.Translate( - "Up until now, all of these things were hosted on different services:", - ) - pd.Data["pinboard"] = lt.Translate("Social bookmarking: Pinboard (Delicious)") - pd.Data["bitly"] = lt.Translate("Link shortening: Bitly et al") - pd.Data["linktree"] = lt.Translate("Link listings: Linktree et al") - pd.Data["line5"] = lt.Translate("Peace Pinboard. Bye Bitly. Later Linktree.") - pd.Data["line6"] = lt.Translate( - "Hello LinkTaco! A single, open source, platform for you to host all of your " + - "links. Custom domains, QR codes, Analytics, full API, multiple organizations " + - "w/ unlimited members are just some of what's included. See the full features " + - "page for more.", - ) - pd.Data["line7"] = lt.Translate( - "Since we're a 100%% open source project you can host your own instance if you'd " + - "like full control over your own platform. See the install docs for more.", - ) - pd.Data["line8"] = lt.Translate( - "Ready to get started? It's free to make an account and use it forever (with " + - "some limitations). To use all features you have to pay just a few bucks a year, " + - "or a few per month if you're a business, and that's it. Simple!", - ) - - pd.Data["login"] = lt.Translate("Login") - pd.Data["email_address"] = lt.Translate("Email Address") - pd.Data["password"] = lt.Translate("Password") - pd.Data["forgot_password"] = lt.Translate("Forgot Password?") - pd.Data["login"] = lt.Translate("Login") - pd.Data["no_accounts"] = lt.Translate("No accounts? Click here to create one") - - gmap := gobwebs.Map{ - "pd": pd, - } - return links.Render(c, http.StatusOK, "index.html", gmap) - + return s.FeatureTour(c) } func (s *Service) PricingList(c echo.Context) error { @@ -429,9 +377,57 @@ func (s *Service) PricingList(c echo.Context) error { func (s *Service) FeatureTour(c echo.Context) error { lt := localizer.GetSessionLocalizer(c) - pd := localizer.NewPageData(lt.Translate("Explore Features")) - pd.Data["organize_bookmarks"] = lt.Translate("Organize bookmarks") - pd.Data["short_links"] = lt.Translate("Short Links") + + pd := localizer.NewPageData( + lt.Translate("Social bookmarking plus link sharing, shortening and listings all in one app."), + ) + pd.Data["welcome"] = lt.Translate("Welcome to LinkTaco!") + pd.Data["line1"] = lt.Translate( + "Here you can mix all your link saving and sharing needs in one " + + "tight little bundle. Much like a taco. A link taco if you will.", + ) + pd.Data["line2"] = lt.Translate( + "LinkTaco is an open source platform where you can host all of your links. " + + "Custom domains, QR codes, Analytics, full API, multiple organizations w/" + + "unlimited members are just some of what's included.", + ) + pd.Data["line4"] = lt.Translate( + "Social bookmarking is not new, it's just been forgotten. Link shortening with " + + "analytics has been around forever. Link listings became cool once social media " + + "started allowing us to post a link to our websites in our profiles.", + ) + pd.Data["line5"] = lt.Translate( + "Up until now, all of these things were hosted on different services.", + ) + pd.Data["pinboard"] = lt.Translate("Social bookmarking: Pinboard (Delicious)") + pd.Data["bitly"] = lt.Translate("Link shortening: Bitly et al") + pd.Data["linktree"] = lt.Translate("Link listings: Linktree et al") + pd.Data["line3"] = lt.Translate("Peace Pinboard. Bye Bitly. Later Linktree. Hello LinkTaco!") + + repo := "https://code.netlandish.com/~netlandish/links" + pd.Data["line7a"] = lt.Translate("Since we're a") + pd.Data["line7b"] = lt.Translate("100%% open source project") + pd.Data["line7c"] = lt.Translate(" you can host your own instance if you'd " + + "like full control over your own platform. See the install docs for more.", + ) + pd.Data["line8"] = lt.Translate( + "Ready to get started? It's free to make an account and use it forever (with " + + "some limitations). To use all features you have to pay just a few bucks a year, " + + "or a few per month if you're a business, and that's it. Simple!", + ) + + pd.Data["login"] = lt.Translate("Login") + pd.Data["email_address"] = lt.Translate("Email Address") + pd.Data["password"] = lt.Translate("Password") + pd.Data["forgot_password"] = lt.Translate("Forgot Password?") + pd.Data["login"] = lt.Translate("Login") + pd.Data["no_accounts"] = lt.Translate("No accounts? Click here to create one") + + pd.Data["explore"] = lt.Translate("Explore Features") + + // pd := localizer.NewPageData(lt.Translate("Explore Features")) + pd.Data["organize_bookmarks"] = lt.Translate("Organize Bookmarks") + pd.Data["short_links"] = lt.Translate("Link Shortening") pd.Data["link_lists"] = lt.Translate("Link Lists") pd.Data["collaboration"] = lt.Translate("Collaboration") pd.Data["integrations"] = lt.Translate("Integrations") @@ -455,7 +451,7 @@ func (s *Service) FeatureTour(c echo.Context) error { pd.Data["feature_link_short_3"] = lt.Translate("Filter/Search shorts") pd.Data["feature_link_short_4"] = lt.Translate("Unlimited QR codes per short") - pd.Data["feature_link_listings_1"] = lt.Translate("Create link listings (ie, social media bios, etc.)") + pd.Data["feature_link_listings_1"] = lt.Translate("Unlimited link listings (for social media bios, etc.)") pd.Data["feature_link_listings_2"] = lt.Translate("Organize listings by tag") pd.Data["feature_link_listings_3"] = lt.Translate("Filter/Search listings") pd.Data["feature_link_listings_4"] = lt.Translate("Unlimited QR codes per listing") @@ -486,25 +482,22 @@ func (s *Service) FeatureTour(c echo.Context) error { pd.Data["feature_analytics_6"] = lt.Translate("City analytics") pd.Data["feature_analytics_7"] = lt.Translate("Device analytics") - pd.Data["slack_integration"] = lt.Translate("Slack integration") - pd.Data["mattermost"] = lt.Translate("Mattermost") - pd.Data["use_external_tools"] = lt.Translate("Use external tools to access your account") - - pd.Data["import_pinboard"] = lt.Translate("Import from Pinboard, Chrome, Firefox, Safari") - pd.Data["export_json"] = lt.Translate("Export in JSON or HTML format") + pd.Data["widget"] = lt.Translate("Browser bookmark widget") - url := links.GetLinksDomainURL(c) - url.Path = c.Echo().Reverse("core:feature_tour") + // XXX Remove in the future. Testing combined feature/index page + //url := links.GetLinksDomainURL(c) + //url.Path = c.Echo().Reverse("core:feature_tour") seoData := links.GetSEOData(c) - seoData.Title = pd.Title - seoData.Description = lt.Translate("All feature details for LinkTaco.com") - seoData.Keywords = lt.Translate("features, pricing, links, linktaco, feature, plans, pricing plans") - seoData.URL = url.String() - seoData.TwitterURL = url.String() + //seoData.Title = pd.Title + //seoData.Description = lt.Translate("All feature details for LinkTaco.com") + //seoData.Keywords = lt.Translate("features, pricing, links, linktaco, feature, plans, pricing plans") + //seoData.URL = url.String() + //seoData.TwitterURL = url.String() gmap := gobwebs.Map{ "pd": pd, "seoData": seoData, + "repo": repo, } return links.Render(c, http.StatusOK, "feature_tour.html", gmap) } @@ -3742,7 +3735,7 @@ func SwiftLang(c echo.Context) error { } refer := c.Request().Header.Get("Referer") if refer == "" { - refer = c.Echo().Reverse("index") + refer = c.Echo().Reverse("core:index") } return c.Redirect(http.StatusMovedPermanently, refer) } diff --git a/helpers.go b/helpers.go index 6530de5..637b7d8 100644 --- a/helpers.go +++ b/helpers.go @@ -1015,8 +1015,8 @@ func GetSEOData(c echo.Context) *SEOData { seoData := &SEOData{ Title: lt.Translate("Social bookmarking plus link sharing, shortening and listings all in one app."), Description: lt.Translate( - "Welcome to LinkTaco. Where you can mix all your link saving and sharing needs in one " + - "tight little bundle. Much like a taco. A link taco if you will.", + "Welcome to LinkTaco! Here you can mix all your link saving and sharing needs in " + + "one tight little bundle. Much like a taco. A link taco if you will.", ), Keywords: lt.Translate("social bookmarks, bookmarking, links, link sharing, link shortening, link listings, bookmarks, link saving, qr codes, analytics"), URL: url.String(), diff --git a/templates/base.html b/templates/base.html index 088ed2f..748ab74 100644 --- a/templates/base.html +++ b/templates/base.html @@ -68,7 +68,7 @@