[x/go.dev] all: simplify menu configuration

Move from data/site.toml to data/menus.yaml, with non-menu left in data/site.yaml.
Now there is only one data format (YAML) for the web site.

Put the menus in the order they should appear on the site,
instead of having to maintain and sort by weights.
Now the menus can be plain data, with no footprint in the
Go source code at all.

Move data accessor into a top-level template function.
Between that and the menus moving into plain data,
Site is no longer exposed as a concept to templates in any form.

Change-Id: Ib21b7163f8bcd7883a930f72e4bfd88cbb875cf3
X-GoDev-Commit: 22c45b892cb03085b303d54200c701d2e502e4ef
diff --git a/go.dev/cmd/internal/site/md.go b/go.dev/cmd/internal/site/md.go
index bed4fe5..21ab43d 100644
--- a/go.dev/cmd/internal/site/md.go
+++ b/go.dev/cmd/internal/site/md.go
@@ -44,7 +44,7 @@
 // the result as markdown to be converted to HTML.
 // This is the same logic used by the Go web site.
 func markdownTemplateToHTML(markdown string, p *Page) (template.HTML, error) {
-	t := p.Site.clone().New(p.file)
+	t := p.site.clone().New(p.file)
 	if err := tmplfunc.Parse(t, string(p.data)); err != nil {
 		return "", err
 	}
diff --git a/go.dev/cmd/internal/site/page.go b/go.dev/cmd/internal/site/page.go
index 394c5ae..c993027 100644
--- a/go.dev/cmd/internal/site/page.go
+++ b/go.dev/cmd/internal/site/page.go
@@ -39,7 +39,7 @@
 	LinkTitle    string `yaml:"linkTitle"`
 	Pages        []*Page
 	Params       map[string]interface{}
-	Site         *Site
+	site         *Site
 	TheResources []*Resource `yaml:"resources"`
 	Title        string
 	Weight       int
@@ -148,11 +148,11 @@
 	}
 
 	// Load base template.
-	base, err := ioutil.ReadFile(p.Site.file("layouts/site.tmpl"))
+	base, err := ioutil.ReadFile(p.site.file("layouts/site.tmpl"))
 	if err != nil {
 		return err
 	}
-	t := p.Site.clone().New("layouts/site.tmpl")
+	t := p.site.clone().New("layouts/site.tmpl")
 	if err := tmplfunc.Parse(t, string(base)); err != nil {
 		return err
 	}
@@ -162,7 +162,7 @@
 	if layout == "" {
 		layout = "default"
 	}
-	data, err := ioutil.ReadFile(p.Site.file("layouts/" + layout + ".tmpl"))
+	data, err := ioutil.ReadFile(p.site.file("layouts/" + layout + ".tmpl"))
 	if err != nil {
 		return err
 	}
diff --git a/go.dev/cmd/internal/site/site.go b/go.dev/cmd/internal/site/site.go
index 8d569da..0e4773d 100644
--- a/go.dev/cmd/internal/site/site.go
+++ b/go.dev/cmd/internal/site/site.go
@@ -21,35 +21,21 @@
 	"strings"
 	"time"
 
-	"github.com/BurntSushi/toml"
 	"golang.org/x/go.dev/cmd/internal/html/template"
 	"gopkg.in/yaml.v3"
 )
 
 // A Site holds metadata about the entire site.
 type Site struct {
-	BaseURL      string
-	LanguageCode string
-	Title        string
-	Menus        map[string][]*MenuItem `toml:"menu"`
-	IsServer     bool
-	Data         map[string]interface{}
-	pages        []*Page
-	pagesByID    map[string]*Page
-	dir          string
-	redirects    map[string]string
-	base         *template.Template
-}
+	URL   string
+	Title string
 
-// A MenuItem is a single entry in a menu.
-type MenuItem struct {
-	Identifier string
-	Name       string
-	Title      string
-	URL        string
-	Parent     string
-	Weight     int
-	Children   []*MenuItem
+	data      map[string]interface{}
+	pages     []*Page
+	pagesByID map[string]*Page
+	dir       string
+	redirects map[string]string
+	base      *template.Template
 }
 
 // Load loads and returns the site in the directory rooted at dir.
@@ -67,39 +53,20 @@
 		return nil, err
 	}
 
-	// Read site config from config.toml.
-	if _, err := toml.DecodeFile(site.file("config.toml"), &site); err != nil {
-		return nil, fmt.Errorf("parsing site config.toml: %v", err)
+	// Read site config.
+	data, err := ioutil.ReadFile(site.file("data/site.yaml"))
+	if err != nil {
+		return nil, err
 	}
-
-	// Group and sort menus.
-	for name, list := range site.Menus {
-		// Collect top-level items and assign children.
-		topsByID := make(map[string]*MenuItem)
-		var tops []*MenuItem
-		for _, item := range list {
-			if p := topsByID[item.Parent]; p != nil {
-				p.Children = append(p.Children, item)
-				continue
-			}
-			tops = append(tops, item)
-			if item.Identifier != "" {
-				topsByID[item.Identifier] = item
-			}
-		}
-		// Sort each top-level item's child list.
-		for _, item := range tops {
-			c := item.Children
-			sort.Slice(c, func(i, j int) bool { return c[i].Weight < c[j].Weight })
-		}
-		site.Menus[name] = tops
+	if err := yaml.Unmarshal(data, &site); err != nil {
+		return nil, fmt.Errorf("parsing data/site.yaml: %v", err)
 	}
 
 	// Load site data files.
-	// site.Data is a directory tree in which each key points at
+	// site.data is a directory tree in which each key points at
 	// either another directory tree (a subdirectory)
 	// or a parsed yaml file.
-	site.Data = make(map[string]interface{})
+	site.data = make(map[string]interface{})
 	root := site.file("data")
 	err = filepath.Walk(root, func(name string, info os.FileInfo, err error) error {
 		if err != nil {
@@ -111,7 +78,7 @@
 			name = name[len(root)+1:]
 		}
 		if info.IsDir() {
-			site.Data[name] = make(map[string]interface{})
+			site.data[name] = make(map[string]interface{})
 			return nil
 		}
 		if strings.HasSuffix(name, ".yaml") {
@@ -125,7 +92,7 @@
 			}
 
 			elems := strings.Split(name, "/")
-			m := site.Data
+			m := site.data
 			for _, elem := range elems[:len(elems)-1] {
 				m = m[elem].(map[string]interface{})
 			}
@@ -198,7 +165,7 @@
 // newPage returns a new page belonging to site.
 func (site *Site) newPage(short string) *Page {
 	p := &Page{
-		Site:   site,
+		site:   site,
 		id:     short,
 		Params: make(map[string]interface{}),
 	}
diff --git a/go.dev/cmd/internal/site/tmpl.go b/go.dev/cmd/internal/site/tmpl.go
index 1218ea6..d0a9c54 100644
--- a/go.dev/cmd/internal/site/tmpl.go
+++ b/go.dev/cmd/internal/site/tmpl.go
@@ -24,8 +24,7 @@
 
 func (site *Site) initTemplate() error {
 	funcs := template.FuncMap{
-		"absURL":      absURL,
-		"default":     defaultFn,
+		"data":        func() interface{} { return site.data },
 		"dict":        dict,
 		"fingerprint": fingerprint,
 		"first":       first,
@@ -70,15 +69,6 @@
 	}
 }
 
-func absURL(u string) string { return u }
-
-func defaultFn(x, y string) string {
-	if y != "" {
-		return y
-	}
-	return x
-}
-
 type Fingerprint struct {
 	r    *Resource
 	Data struct {
@@ -243,30 +233,22 @@
 }
 
 func (p *Page) CurrentSection() *Page {
-	return p.Site.pagesByID[p.section]
-}
-
-func (d *Page) HasMenuCurrent(x string, y *MenuItem) bool {
-	return false
+	return p.site.pagesByID[p.section]
 }
 
 func (p *Page) IsHome() bool { return p.id == "" }
 
-func (d *Page) IsMenuCurrent(x string, y *MenuItem) bool {
-	return d.Permalink() == y.URL
-}
-
 func (p *Page) Param(key string) interface{} { return p.Params[key] }
 
 func (p *Page) Parent() *Page {
 	if p.IsHome() {
 		return nil
 	}
-	return p.Site.pagesByID[p.parent]
+	return p.site.pagesByID[p.parent]
 }
 
 func (p *Page) Permalink() string {
-	return strings.TrimRight(p.Site.BaseURL, "/") + p.RelPermalink()
+	return strings.TrimRight(p.site.URL, "/") + p.RelPermalink()
 }
 
 func (p *Page) RelPermalink() string {
@@ -295,7 +277,7 @@
 		if name == rs.Name {
 			if rs.data == nil {
 				rs.RelPermalink = strings.TrimPrefix(filepath.ToSlash(filepath.Join(r.p.file, "../"+rs.Src)), "content")
-				data, err := os.ReadFile(r.p.Site.file(r.p.file + "/../" + rs.Src))
+				data, err := os.ReadFile(r.p.site.file(r.p.file + "/../" + rs.Src))
 				if err != nil {
 					return nil, err
 				}
diff --git a/go.dev/config.toml b/go.dev/config.toml
deleted file mode 100644
index 9ed511e..0000000
--- a/go.dev/config.toml
+++ /dev/null
@@ -1,186 +0,0 @@
-baseURL = "https://go.dev/"
-languageCode = "en"
-title = "go.dev"
-
-[markup]
-  defaultMarkdownHandler = "blackfriday"
-
-[blackfriday]
-  plainIDAnchors = true
-  hrefTargetBlank = true
-  noreferrerLinks = true
-
-[taxonomies]
-  category = "categories"
-  series = "series"
-  tag = "tags"
-
-[menu]
-  [[menu.main]]
-    identifier = "solutions"
-    name = "Why Go"
-    title = "Why Go"
-    url = "https://go.dev/solutions"
-    weight = -110
-
-  [[menu.main]]
-    identifier = "learn"
-    name = "Getting Started"
-    title = "Getting Started"
-    url = "https://go.dev/learn"
-    weight = -100
-
-  [[menu.main]]
-    identifier = "explore"
-    name = "Discover Packages"
-    title = "Discover Packages"
-    url = "https://pkg.go.dev"
-    weight = -90
-
-  [[menu.main]]
-    identifier = "about"
-    name = "About"
-    title = "About"
-    url = "https://go.dev/about"
-    weight = -80
-
-  [[menu.footer]]
-    identifier = "solutions"
-    name = "Why Go"
-    title = "Why Go"
-    url = "https://go.dev/solutions"
-    weight = -110
-
-  [[menu.footer]]
-    identifier = "usecases"
-    name = "Use Cases"
-    title = "Use Cases"
-    url = "https://go.dev/solutions#use-cases"
-    parent = "solutions"
-    weight = -112
-
-  [[menu.footer]]
-    identifier = "casestudies"
-    name = "Case Studies"
-    title = "Case Studies"
-    url = "https://go.dev/solutions#case-studies"
-    parent = "solutions"
-    weight = -111
-
-  [[menu.footer]]
-    identifier = "learn"
-    name = "Getting Started"
-    title = "Getting Started"
-    url = "https://go.dev/learn"
-    weight = -100
-
-  [[menu.footer]]
-    name = "Playground"
-    url = "https://play.golang.org"
-    parent = "learn"
-    weight = -90
-
-  [[menu.footer]]
-    name = "Tour"
-    url = "https://tour.golang.org"
-    parent = "learn"
-    weight = -80
-
-  [[menu.footer]]
-    name = "Stack Overflow"
-    url = "https://stackoverflow.com/questions/tagged/go?tab=Newest"
-    parent = "learn"
-    weight = -70
-
-  [[menu.footer]]
-    identifier = "explore"
-    name = "Discover Packages"
-    title = "Discover Packages"
-    url = "https://pkg.go.dev"
-    weight = -90
-
-  [[menu.footer]]
-    identifier = "about"
-    name = "About"
-    title = "About"
-    url = "https://go.dev/about"
-    weight = -80
-
-  [[menu.footer]]
-    name = "Download"
-    parent = "about"
-    url = "https://golang.org/dl/"
-    weight = -70
-
-  [[menu.footer]]
-    name = "Blog"
-    parent = "about"
-    url = "https://blog.golang.org"
-    weight = -60
-
-  [[menu.footer]]
-    name = "Issue Tracker"
-    parent = "about"
-    url = "https://github.com/golang/go/issues"
-    weight = -50
-
-  [[menu.footer]]
-    name = "Release Notes"
-    parent = "about"
-    url = "https://golang.org/doc/devel/release.html"
-    weight = -50
-
-  [[menu.footer]]
-    name = "Brand Guidelines"
-    parent = "about"
-    url = "https://blog.golang.org/go-brand"
-    weight = -40
-
-  [[menu.footer]]
-    name = "Code of Conduct"
-    parent = "about"
-    url = "https://golang.org/conduct"
-    weight = -30
-
-  [[menu.footer]]
-    identifier = "connect"
-    name = "Connect"
-    title = "Connect"
-    url = "https://www.twitter.com/golang"
-    weight = -70
-
-  [[menu.footer]]
-    name = "r/golang"
-    parent = "connect"
-    url = "https://reddit.com/r/golang"
-    weight = -35
-
-  [[menu.footer]]
-    name = "Twitter"
-    parent = "connect"
-    url = "https://www.twitter.com/golang"
-    weight = -70
-
-  [[menu.footer]]
-    name = "Github"
-    parent = "connect"
-    url = "https://github.com/golang"
-    weight = -50
-
-  [[menu.footer]]
-    name = "Slack"
-    parent = "connect"
-    url = "https://invite.slack.golangbridge.org/"
-    weight = -40
-
-  [[menu.footer]]
-    name = "Meetup"
-    parent = "connect"
-    url = "https://www.meetup.com/pro/go"
-    weight = -30
-
-  [[menu.footer]]
-    name = "Golang Weekly"
-    parent = "connect"
-    url = "https://golangweekly.com/"
-    weight = -20
diff --git a/go.dev/content/index.md b/go.dev/content/index.md
index 84fd740..3d2c2de 100644
--- a/go.dev/content/index.md
+++ b/go.dev/content/index.md
@@ -35,7 +35,7 @@
     </div>
     <div class="Hero-actions">
       <div
-        data-version="{{.Site.Data.global.latestVersion}}"
+        data-version="{{data.global.latestVersion}}"
         class="js-latestGoVersion">
         <a class="Primary" href="https://learn.go.dev/">Get Started</a>
         <a class="Secondary js-downloadBtn"
@@ -120,7 +120,7 @@
     <div class="GoCarousel-controlsContainer">
       <div class="GoCarousel-wrapper">
         <ul class="js-testimonialsGoQuotes TestimonialsGo-quotes">
-          {{ range $index, $element := $.Site.Data.testimonials.all }}
+          {{ range $index, $element := data.testimonials.all }}
             <li class="TestimonialsGo-quoteGroup GoCarousel-slide" id="quote_slide{{$index}}">
               <div class="TestimonialsGo-quoteSingleItem">
                 <div class="TestimonialsGo-quoteSection">
@@ -154,7 +154,7 @@
       </h4>
     </div>
     <ul class="WhyGo-reasons">
-      {{ range first 4 $.Site.Data.resources.resources }}
+      {{ range first 4 data.resources.resources }}
         <li class="WhyGo-reason">
           <div class="WhyGo-reasonDetails">
             <div class="WhyGo-reasonIcon" role="presentation">
@@ -189,7 +189,7 @@
           </div>
         </li>
       {{end}}
-      {{ if (gt ($.Site.Data.resources.resources | len) 3) }}
+      {{ if (gt (data.resources.resources | len) 3) }}
         <li class="WhyGo-reason">
           <div class="WhyGo-reasonShowMore">
             <div class="WhyGo-reasonShowMoreImgWrapper">
@@ -217,7 +217,7 @@
     <div class="GoCarousel-controlsContainer">
       <div class="GoCarousel-eventsWrapper">
         <ul class="js-goCarouselEventsSlides GoCarousel-eventsSlides">
-          {{ range $index, $element := $.Site.Data.events.all }}
+          {{ range $index, $element := data.events.all }}
             <li
             class="GoCarousel-eventGroup"
             id="event_slide{{$index}}">
@@ -313,7 +313,7 @@
         <li class="GettingStartedGo-resourcesHeader">
           In-Person Trainings
         </li>
-        {{range first 4 $.Site.Data.learn.inPerson.links }}
+        {{range first 4 data.learn.inPerson.links }}
           <li class="GettingStartedGo-resourceItem">
             <a href="{{.url}}" class="GettingStartedGo-resourceItemTitle">
               {{.title}}
diff --git a/go.dev/content/learn/_index.md b/go.dev/content/learn/_index.md
index b5efc4f..2bbced1 100644
--- a/go.dev/content/learn/_index.md
+++ b/go.dev/content/learn/_index.md
@@ -17,7 +17,7 @@
         </p>
         <div class="Learn-heroAction">
           <div
-            data-version="{{.Site.Data.global.latestVersion}}"
+            data-version="{{data.global.latestVersion}}"
             class="js-latestGoVersion"
           >
             <a
@@ -45,7 +45,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-quickstarts Learn-cardList">
-        {{ range first 3 $.Site.Data.learn.quickstart.links }}
+        {{ range first 3 data.learn.quickstart.links }}
           <li class="Learn-quickstart Learn-card">
             {{template "learn-card" .}}
           </li>
@@ -66,7 +66,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-cardList">
-        {{ range first 4 $.Site.Data.learn.guidedLearning.links }}
+        {{ range first 4 data.learn.guidedLearning.links }}
           <li class="Learn-card">
             {{template "learn-card" .}}
           </li>
@@ -83,7 +83,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-cardList">
-        {{ range first 4 $.Site.Data.learn.courses.links }}
+        {{ range first 4 data.learn.courses.links }}
           <li class="Learn-card">
             {{template "learn-card" .}}
           </li>
@@ -100,7 +100,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-cardList">
-        {{ range first 4 $.Site.Data.learn.cloud.links }}
+        {{ range first 4 data.learn.cloud.links }}
           <li class="Learn-card">
             {{template "learn-self-paced-card" .}}
           </li>
@@ -118,7 +118,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-cardList Learn-bookList">
-        {{ range first 5 $.Site.Data.learn.books.links }}
+        {{ range first 5 data.learn.books.links }}
           <li class="Learn-card Learn-book">
             {{template "learn-book" .}}
           </li>
@@ -135,7 +135,7 @@
     </div>
     <div class="LearnGo-gridContainer">
       <ul class="Learn-inPersonList">
-        {{range first 4 $.Site.Data.learn.inPerson.links}}
+        {{range first 4 data.learn.inPerson.links}}
         <li class="Learn-inPerson">
           <p class="Learn-inPersonTitle">
             <a href="{{.url}}">{{.title}} </a>
@@ -157,7 +157,7 @@
       </p>
     </div>
     <ul class="Learn-events">
-      {{range first 3 $.Site.Data.events.all}}
+      {{range first 3 data.events.all}}
       <li class="Learn-eventItem">
         <div
           class="Learn-eventThumbnail {{if not .photourl}}Learn-eventThumbnail--noimage{{end}}"
diff --git a/go.dev/data/menus.yaml b/go.dev/data/menus.yaml
new file mode 100644
index 0000000..e902090
--- /dev/null
+++ b/go.dev/data/menus.yaml
@@ -0,0 +1,63 @@
+main:
+  - name: Why Go
+    url: https://go.dev/solutions
+  - name: Getting Started
+    url: https://learn.go.dev
+  - name: Discover Packages
+    url: https://pkg.go.dev
+  - name: About
+    url: https://go.dev/about
+
+footer:
+  - name: Why Go
+    url: https://go.dev/solutions
+    children:
+    - name: Use Cases
+      url: https://go.dev/solutions#use-cases
+    - name: Case Studies
+      url: https://go.dev/solutions#case-studies
+
+  - name: Getting Started
+    url: https://go.dev/learn
+    children:
+    - name: Playground
+      url: https://play.golang.org
+    - name: Tour
+      url: https://tour.golang.org
+    - name: Stack Overflow
+      url: https://stackoverflow.com/questions/tagged/go?tab=Newest
+
+  - name: Discover Packages
+    url: https://pkg.go.dev
+
+  - name: About
+    url: https://go.dev/about
+    children:
+    - name: Download
+      url: https://golang.org/dl/
+    - name: Blog
+      url: https://blog.golang.org
+    - name: Issue Tracker
+      url: https://github.com/golang/go/issues
+    - name: Release Notes
+      url: https://golang.org/doc/devel/release.html
+    - name: Brand Guidelines
+      url: https://blog.golang.org/go-brand
+    - name: Code of Conduct
+      url: https://golang.org/conduct
+
+  - name: Connect
+    url: https://www.twitter.com/golang
+    children:
+    - name: Twitter
+      url: https://www.twitter.com/golang
+    - name: Github
+      url: https://github.com/golang
+    - name: Slack
+      url: https://invite.slack.golangbridge.org/
+    - name: r/golang
+      url: https://reddit.com/r/golang
+    - name: Meetup
+      url: https://www.meetup.com/pro/go
+    - name: Golang Weekly
+      url: https://golangweekly.com/
diff --git a/go.dev/data/site.yaml b/go.dev/data/site.yaml
new file mode 100644
index 0000000..6878875
--- /dev/null
+++ b/go.dev/data/site.yaml
@@ -0,0 +1,2 @@
+url: https://go.dev/
+title: go.dev
diff --git a/go.dev/go.mod b/go.dev/go.mod
index 55634a6..4ffd817 100644
--- a/go.dev/go.mod
+++ b/go.dev/go.mod
@@ -3,7 +3,6 @@
 go 1.13
 
 require (
-	github.com/BurntSushi/toml v0.3.1
 	github.com/google/go-cmp v0.3.1
 	github.com/microcosm-cc/bluemonday v1.0.2
 	github.com/russross/blackfriday v1.6.0
diff --git a/go.dev/go.sum b/go.dev/go.sum
index 0fe3626..5b62548 100644
--- a/go.dev/go.sum
+++ b/go.dev/go.sum
@@ -2,7 +2,6 @@
 cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
 cloud.google.com/go v0.38.0 h1:ROfEUZz+Gh5pa62DJWXSaonyu3StP6EA6lPEXPI6mCo=
 cloud.google.com/go v0.38.0/go.mod h1:990N+gfupTy94rShfmMCWGDn0LpTmnzTp2qbd1dvSRU=
-github.com/BurntSushi/toml v0.3.1 h1:WXkYYl6Yr3qBf1K79EBnL4mak0OimBfB0XUf9Vl28OQ=
 github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
 github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
 github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b h1:VKtxabqXZkF25pY9ekfRL6a582T4P37/31XEstQ5p58=
diff --git a/go.dev/layouts/site.tmpl b/go.dev/layouts/site.tmpl
index eda0305..6df7d21 100644
--- a/go.dev/layouts/site.tmpl
+++ b/go.dev/layouts/site.tmpl
@@ -1,5 +1,5 @@
 <!DOCTYPE html>
-<html lang="{{or $.Site.LanguageCode "en"}}">
+<html lang="en">
 <head>
 <!-- Google Tag Manager -->
 <link rel="preconnect" href="https://www.googletagmanager.com">
@@ -15,12 +15,8 @@
 <meta name="theme-color" content="#00add8">
 <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Google+Sans:400,500,600|Work+Sans:400,500,600|Roboto:400,500,700|Open+Sans:Source+Code+Pro|Material+Icons">
 {{$styles := resources.Get "css/styles.css" -}}
-{{if .Site.IsServer -}}
-  <link rel="stylesheet" href="{{$styles.RelPermalink}}">
-{{else -}}
-  {{$stylesFP := $styles | fingerprint -}}
-  <link rel="stylesheet" href="{{$stylesFP.RelPermalink}}" integrity="{{$stylesFP.Data.Integrity}}">
-{{end -}}
+{{$stylesFP := $styles | fingerprint -}}
+<link rel="stylesheet" href="{{$stylesFP.RelPermalink}}" integrity="{{$stylesFP.Data.Integrity}}">
   <!-- Google Tag Manager -->
   <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({'gtm.start':
   new Date().getTime(),event:'gtm.js'});var f=d.getElementsByTagName(s)[0],
@@ -29,7 +25,7 @@
   })(window,document,'script','dataLayer','GTM-W8MVQXG');</script>
   <!-- End Google Tag Manager -->
 <script src="/js/site.js"></script>
-<title>{{.Title}}{{if not .IsHome}} - {{.Site.Title}}{{end}}</title>
+<title>{{.Title}}{{if not .IsHome}} - go.dev{{end}}</title>
 {{if (isset .Params "link") -}}
 <meta http-equiv="refresh" content="0; url={{.Params.link}}">
 {{end -}}
@@ -53,7 +49,7 @@
   </div>
   <div class="Header Header--dark">
     <nav class="Header-nav">
-      <a href="{{.Site.BaseURL}}">
+      <a href="https://go.dev/">
         <img
           class="js-headerLogo Header-logo"
           src="/images/go-logo-white.svg"
@@ -63,16 +59,9 @@
         {{template "search-form" .}}
         <ul class="Header-menu">
           {{- $currentPage := .}}
-          {{- range .Site.Menus.main}}
-          {{- $url := .URL}}
-          {{- if and (not $currentPage.Site.IsServer) (eq .Identifier "learn")}}
-            {{- $url = "https://learn.go.dev"}}
-          {{- end}}
-          {{- if not $currentPage.Site.IsServer}}
-            {{- $url = $url | absURL}}
-          {{- end}}
-          <li class="Header-menuItem {{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) (eq $currentPage.Title .Name)}} Header-menuItem--active{{end}}">
-            <a href="{{$url}}">{{.Name}}</a>
+          {{- range data.menus.main}}
+          <li class="Header-menuItem {{if eq $currentPage.Title .name}} Header-menuItem--active{{end}}">
+            <a href="{{.url}}">{{.name}}</a>
           </li>
           {{- end}}
         </ul>
@@ -99,40 +88,37 @@
 <aside class="NavigationDrawer js-header">
   <nav class="NavigationDrawer-nav">
     <div class="NavigationDrawer-header">
-      <a href="{{.Site.BaseURL}}">
+      <a href="https://go.dev/">
         <img class="NavigationDrawer-logo" src="/images/go-logo-blue.svg" alt="Go.">
       </a>
     </div>
     <ul class="NavigationDrawer-list">
-      {{- range .Site.Menus.main}}
-        {{- $url := .URL}}
-        {{- if and (not $currentPage.Site.IsServer) (eq .Identifier "learn")}}
-          {{- $url = "https://learn.go.dev"}}
-        {{- end}}
-        {{- if not $currentPage.Site.IsServer}}
-          {{- $url = $url | absURL}}
-        {{- end}}
-        <li class="NavigationDrawer-listItem {{if or ($currentPage.IsMenuCurrent "main" .) ($currentPage.HasMenuCurrent "main" .) (eq $currentPage.CurrentSection.Title .Name)}} NavigationDrawer-listItem--active{{end}}">
-          <a href="{{$url}}">{{.Name}}</a>
+      {{- range data.menus.main}}
+        <li class="NavigationDrawer-listItem {{if eq $currentPage.CurrentSection.Title .name}} NavigationDrawer-listItem--active{{end}}">
+          <a href="{{.url}}">{{.name}}</a>
         </li>
       {{- end}}
     </ul>
   </nav>
 </aside>
 <div class="NavigationDrawer-scrim js-scrim" role="presentation"></div>
-<main class="SiteContent{{if $.Site.Data.messaging.messaging.HeaderMessagingBar }} SiteContent--lower{{else}} SiteContent--default{{end}}">
+<main class="SiteContent{{if data.messaging.messaging.HeaderMessagingBar }} SiteContent--lower{{else}} SiteContent--default{{end}}">
   {{- block "layout" . -}}{{- end -}}
 </main>
 <footer class="Site-footer">
   <div class="Footer">
     <div class="Container">
       <div class="Footer-links">
-        {{- range .Site.Menus.footer}}
+        {{- range data.menus.footer}}
           <div class="Footer-linkColumn">
-            {{template "footer-link" (dict "menuItem" . "Site" $currentPage.Site)}}
-            {{- range .Children}}
-              {{template "footer-link" (dict "menuItem" . "Site" $currentPage.Site)}}
-            {{end}}
+            <a href="{{.url}}" class="Footer-link Footer-link--primary">
+              {{.name}}
+            </a>
+            {{- range .children}}
+              <a href="{{.url}}" class="Footer-link">
+                {{.name}}
+              </a>
+            {{- end}}
           </div>
         {{- end}}
       </div>
@@ -204,16 +190,3 @@
         </input>
 </form>
 {{end}}
-
-{{define "footer-link"}}
-{{- $url := .menuItem.URL}}
-{{- if and (not .Site.IsServer) (eq .Identifier "learn")}}
-  {{- $url = "https://learn.go.dev"}}
-{{- end}}
-{{- if not .Site.IsServer}}
-  {{- $url = $url | absURL}}
-{{- end}}
-<a href="{{$url}}" class="Footer-link{{if not .menuItem.Parent}} Footer-link--primary{{end}}">
-  {{.menuItem.Name}}
-</a>
-{{end}}
diff --git a/go.dev/templates/breadcrumbs.tmpl b/go.dev/templates/breadcrumbs.tmpl
index be0fe87..689dd12 100644
--- a/go.dev/templates/breadcrumbs.tmpl
+++ b/go.dev/templates/breadcrumbs.tmpl
@@ -1,8 +1,6 @@
 {{define "breadcrumbnav"}}
 {{- if .p1.Parent}}
   {{- template "breadcrumbnav" (dict "p1" .p1.Parent "p2" .p2 )}}
-{{- else if not .p1.IsHome}}
-  {{- template "breadcrumbnav" (dict "p1" .p1.Site.Home "p2" .p2 ) }}
 {{- end}}
 {{- if not (eq .p1.Title "go.dev")}}
       <li class="BreadcrumbNav-li {{if eq .p1 .p2}}active{{end}}">