[x/go.dev] all: fix mobile nav "Why Go" highlights

In the mobile menu the pages in the Google section did not
highlight "Why Go" the same way as the pages in the rest of
the Solutions section. This is a bug in the current web site
which we were mimicking, but it seems worth fixing, which
will be better UX and also simplify the code.

The root cause of the problem is apparently confusion between
Hugo's Section and CurrentSection. Section returns a string, and
CurrentSection returns a Page, but that's not the only difference:
they also use subtly different meanings of the term “section”.
Specifically, Section uses the topmost section (solutions even for
solutions/google or solutions/google/chrome),
while CurrentSection uses any deeper section if present
(solutions/google for those two cases).
For the purposes of the menu, we only care about being in the
top-level "solutions" section. So use that meaning in CurrentSection,
diverging from Hugo but making the site better.

The CurrentSection name will go away entirely later.

Change-Id: I102907f347f0472527e0f48fe35280e92b9ea0d4
X-GoDev-Commit: 05f65502deea650f0d496622a9608bc212ec33b5
6 files changed
tree: 6d405ba4c14b8073800229261e9fbaf3dc8ea49f
  1. go.dev/
  2. AUTHORS
  3. CONTRIBUTING.md
  4. CONTRIBUTORS
  5. LICENSE
  6. PATENTS
  7. README.md
README.md

Go Website

This repository holds the Go Website server code and content.

Download/Install

The easiest way to install is to run go get -u golang.org/x/website. You can also manually git clone the repository to $GOPATH/src/golang.org/x/website.

Report Issues / Send Patches

This repository uses Gerrit for code changes. To learn how to submit changes to this repository, see https://golang.org/doc/contribute.html.

The main issue tracker for the time repository is located at https://github.com/golang/go/issues. Prefix your issue with “x/website:” in the subject line, so it is easy to find.