internal/frontend: change page title depending on users location

Differentiate between home, search and package pages
in the sites title so users can tell them apart
easily when having multiple tabs open.

Fixes golang/go#41105

Change-Id: I9387d938b9bcbd2c610d2c38cb6cc13e661d8e04
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/275535
Reviewed-by: Julie Qiu <julie@golang.org>
Trust: Julie Qiu <julie@golang.org>
Trust: Jonathan Amsterdam <jba@google.com>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
diff --git a/internal/frontend/details.go b/internal/frontend/details.go
index b62fe95..f6b5b2e 100644
--- a/internal/frontend/details.go
+++ b/internal/frontend/details.go
@@ -28,7 +28,7 @@
 		return &serverError{status: http.StatusMethodNotAllowed}
 	}
 	if r.URL.Path == "/" {
-		s.staticPageHandler("index.tmpl", "")(w, r)
+		s.staticPageHandler("index.tmpl", "Home")(w, r)
 		return nil
 	}
 
diff --git a/internal/frontend/search.go b/internal/frontend/search.go
index a8874ba..8a744b7 100644
--- a/internal/frontend/search.go
+++ b/internal/frontend/search.go
@@ -174,7 +174,7 @@
 	if err != nil {
 		return fmt.Errorf("fetchSearchPage(ctx, db, %q): %v", query, err)
 	}
-	page.basePage = s.newBasePage(r, query)
+	page.basePage = s.newBasePage(r, fmt.Sprintf("%s - Search Results", query))
 	s.servePage(ctx, w, "search.tmpl", page)
 	return nil
 }
diff --git a/internal/frontend/server.go b/internal/frontend/server.go
index 587e171..339ff32 100644
--- a/internal/frontend/server.go
+++ b/internal/frontend/server.go
@@ -132,7 +132,7 @@
 	handle("/fetch/", fetchHandler)
 	handle("/play/", http.HandlerFunc(s.handlePlay))
 	handle("/search", searchHandler)
-	handle("/search-help", s.staticPageHandler("search_help.tmpl", "Search Help - go.dev"))
+	handle("/search-help", s.staticPageHandler("search_help.tmpl", "Search Help"))
 	handle("/license-policy", s.licensePolicyHandler())
 	handle("/about", http.RedirectHandler("https://go.dev/about", http.StatusFound))
 	handle("/badge/", http.HandlerFunc(s.badgeHandler))