content/static: replace empty query href with full url path in header

Replaces empty query string href with full path
for main page link in header. Removes "?" from url
when going back to main page from meta page.

Change-Id: Id3246d7914003b1436e098db06257438e5c9db2f
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/264200
Trust: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Julie Qiu <julie@golang.org>
diff --git a/content/static/html/helpers/_unit_fixed_header.tmpl b/content/static/html/helpers/_unit_fixed_header.tmpl
index 8d19a54..a378812 100644
--- a/content/static/html/helpers/_unit_fixed_header.tmpl
+++ b/content/static/html/helpers/_unit_fixed_header.tmpl
@@ -93,7 +93,7 @@
             </select>
           </div>
         {{else}}
-          <a class="UnitFixedHeader-backLink" href="?">
+          <a class="UnitFixedHeader-backLink" href="{{.URLPath}}">
             <img height="16px" width="16px" src="/static/img/pkg-icon-arrowLeft_16x16.svg" alt=""> Go to main page
           </a>
         {{end}}
diff --git a/content/static/html/helpers/_unit_header.tmpl b/content/static/html/helpers/_unit_header.tmpl
index c35c23b..95a3eb1 100644
--- a/content/static/html/helpers/_unit_header.tmpl
+++ b/content/static/html/helpers/_unit_header.tmpl
@@ -103,7 +103,7 @@
           <div style="display: none;" class="DetailsHeader-badge $$GODISCOVERY_LATESTMINORCLASS$$"
               data-version="{{.LinkVersion}}" data-mpath="{{.Unit.ModulePath}}" data-ppath="{{.Unit.Path}}" data-pagetype="{{.PageType}}">
           </div>
-          <a class="UnitHeader-backLink" href="?">
+          <a class="UnitHeader-backLink" href="{{.URLPath}}">
             <img height="16px" width="16px" src="/static/img/pkg-icon-arrowLeft_16x16.svg" alt=""> Go to main page
           </a>
           </span>