_content: Breadcrumbs added to children pages.
Added to all doc children page with doclayout.
Added to Why Go pages.
Added to Security pages.
Video of Changes:
https://drive.google.com/file/d/1wX9e9K9H9wPTaLLQHh15-cWzMTMRr9DO/view?usp=sharing
Change-Id: I0fbf8e925e7fa357762d8eebd2bf13d561d49d86
Reviewed-on: https://go-review.googlesource.com/c/website/+/432775
Reviewed-by: Jamal Carvalho <jamal@golang.org>
Run-TryBot: Jamal Carvalho <jamal@golang.org>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Hyang-Ah Hana Kim <hyangah@gmail.com>
diff --git a/_content/article.tmpl b/_content/article.tmpl
index fec661b..8f3164c 100644
--- a/_content/article.tmpl
+++ b/_content/article.tmpl
@@ -5,6 +5,9 @@
<div class="Article-columns">
<div class="Article-content">
{{end}}
+ {{- if .breadcrumb}}
+ {{ breadcrumbs . }}
+ {{- end}}
<h1>{{.title}}</h1>
{{.Content}}
diff --git a/_content/css/styles.css b/_content/css/styles.css
index fede720..a875d18 100644
--- a/_content/css/styles.css
+++ b/_content/css/styles.css
@@ -949,6 +949,13 @@
max-width: 75.75rem;
padding: 0 0 1rem;
}
+.SiteBreadcrumb {
+ list-style:none;
+ display:flex;
+ align-items:center;
+ padding:0;
+ margin: 1.5rem 0;
+}
.BreadcrumbNav-li {
align-items: center;
display: flex;
@@ -988,11 +995,6 @@
width: 1rem;
}
}
-@media only screen and (min-width: 57.7rem) {
- .BreadcrumbNav-inner {
- margin-top: 0;
- }
-}
.SubHero-gridContainer,
.WhoUses-gridContainer,
.Playground-gridContainer,
@@ -2235,7 +2237,7 @@
padding-top: 1.125rem;
}
-.Learn-heroContent a:not(.js-downloadBtn) {
+.Learn-heroContent a:not(.js-downloadBtn):not(.BreadcrumbNav-link) {
text-decoration: underline;
}
diff --git a/_content/doc/articles/wiki/index.html b/_content/doc/articles/wiki/index.html
index b88a820..4a447ea 100644
--- a/_content/doc/articles/wiki/index.html
+++ b/_content/doc/articles/wiki/index.html
@@ -1,6 +1,7 @@
<!--{
"Title": "Writing Web Applications",
- "Template": true
+ "Template": true,
+ "Breadcrumb": true
}-->
<h2>Introduction</h2>
diff --git a/_content/doc/cmd.html b/_content/doc/cmd.html
index 61f0faa..958eab6 100644
--- a/_content/doc/cmd.html
+++ b/_content/doc/cmd.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Command Documentation"
+ "Title": "Command Documentation",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/code.html b/_content/doc/code.html
index 1219cf3..79ec9bb 100644
--- a/_content/doc/code.html
+++ b/_content/doc/code.html
@@ -1,6 +1,7 @@
<!--{
"Title": "How to Write Go Code",
- "Template": true
+ "Template": true,
+ "Breadcrumb": true
}-->
<h2 id="Introduction">Introduction</h2>
diff --git a/_content/doc/contribute.html b/_content/doc/contribute.html
index c68d0b4..832b5af 100644
--- a/_content/doc/contribute.html
+++ b/_content/doc/contribute.html
@@ -1,6 +1,7 @@
<!--{
"Title": "Contribution Guide",
- "Template": true
+ "Template": true,
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/database/index.md b/_content/doc/database/index.md
index ab54513..0e65302 100644
--- a/_content/doc/database/index.md
+++ b/_content/doc/database/index.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Accessing relational databases"
+ "Title": "Accessing relational databases",
+ "Breadcrumb": true
}-->
Using Go, you can incorporate a wide variety of databases and data access
diff --git a/_content/doc/database/open-handle.md b/_content/doc/database/open-handle.md
index f14902d..528efd1 100644
--- a/_content/doc/database/open-handle.md
+++ b/_content/doc/database/open-handle.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Opening a database handle"
+ "Title": "Opening a database handle",
+ "Breadcrumb": true
}-->
The [`database/sql`](https://pkg.go.dev/database/sql) package simplifies
diff --git a/_content/doc/diagnostics.html b/_content/doc/diagnostics.html
index 650978d..c59cbdd 100644
--- a/_content/doc/diagnostics.html
+++ b/_content/doc/diagnostics.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Diagnostics"
+ "Title": "Diagnostics",
+ "Breadcrumb": true
}-->
<!--
diff --git a/_content/doc/editors.html b/_content/doc/editors.html
index 79cbd52..c2bdf03 100644
--- a/_content/doc/editors.html
+++ b/_content/doc/editors.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Editor plugins and IDEs"
+ "Title": "Editor plugins and IDEs",
+ "Breadcrumb": true
}-->
<h2 id="introduction">Introduction</h2>
diff --git a/_content/doc/effective_go.html b/_content/doc/effective_go.html
index 7c4b475..78d5d27 100644
--- a/_content/doc/effective_go.html
+++ b/_content/doc/effective_go.html
@@ -1,6 +1,7 @@
<!--{
"Title": "Effective Go",
- "Template": true
+ "Template": true,
+ "Breadcrumb": true
}-->
<h2 id="introduction">Introduction</h2>
diff --git a/_content/doc/faq.html b/_content/doc/faq.html
index f4f70e9..f66162d 100644
--- a/_content/doc/faq.html
+++ b/_content/doc/faq.html
@@ -1,6 +1,7 @@
<!--{
"Title": "Frequently Asked Questions (FAQ)",
- "Sidebar": "faq"
+ "Sidebar": "faq",
+ "Breadcrumb": true
}-->
<h2 id="Origins">Origins</h2>
diff --git a/_content/doc/gc-guide.html b/_content/doc/gc-guide.html
index f58001b..7f59ca9 100644
--- a/_content/doc/gc-guide.html
+++ b/_content/doc/gc-guide.html
@@ -1,6 +1,7 @@
<!--{
"Title": "A Guide to the Go Garbage Collector",
- "Path": "/doc/gc-guide"
+ "Path": "/doc/gc-guide",
+ "Breadcrumb": true
}-->
<!--
diff --git a/_content/doc/gccgo_contribute.html b/_content/doc/gccgo_contribute.html
index 64a44eb..22016e1 100644
--- a/_content/doc/gccgo_contribute.html
+++ b/_content/doc/gccgo_contribute.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Contributing to the gccgo frontend"
+ "Title": "Contributing to the gccgo frontend",
+ "Breadcrumb": true
}-->
<h2>Introduction</h2>
diff --git a/_content/doc/gdb.html b/_content/doc/gdb.html
index 1db0705..137aecc 100644
--- a/_content/doc/gdb.html
+++ b/_content/doc/gdb.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Debugging Go Code with GDB"
+ "Title": "Debugging Go Code with GDB",
+ "Breadcrumb": true
}-->
<!--
diff --git a/_content/doc/go-get-install-deprecation.md b/_content/doc/go-get-install-deprecation.md
index e81182b..070ab5d 100644
--- a/_content/doc/go-get-install-deprecation.md
+++ b/_content/doc/go-get-install-deprecation.md
@@ -1,6 +1,7 @@
<!--{
"Title": "Deprecation of 'go get' for installing executables",
- "Path": "/doc/go-get-install-deprecation"
+ "Path": "/doc/go-get-install-deprecation",
+ "Breadcrumb": true
}-->
## Overview
diff --git a/_content/doc/go1compat.html b/_content/doc/go1compat.html
index 74732ca..8ca6116 100644
--- a/_content/doc/go1compat.html
+++ b/_content/doc/go1compat.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Go 1 and the Future of Go Programs"
+ "Title": "Go 1 and the Future of Go Programs",
+ "Breadcrumb": true
}-->
<h2 id="introduction">Introduction</h2>
diff --git a/_content/doc/gopath_code.html b/_content/doc/gopath_code.html
index 6f6fce6..6c3b536 100644
--- a/_content/doc/gopath_code.html
+++ b/_content/doc/gopath_code.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "How to Write Go Code (with GOPATH)"
+ "Title": "How to Write Go Code (with GOPATH)",
+ "Breadcrumb": true
}-->
<h2 id="Introduction">Introduction</h2>
diff --git a/_content/doc/install.html b/_content/doc/install.html
index 855157b..bc4e829 100644
--- a/_content/doc/install.html
+++ b/_content/doc/install.html
@@ -1,7 +1,8 @@
<!--{
"Title": "Download and install",
"HideTOC": true,
- "Sidebar": "bug"
+ "Sidebar": "bug",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/install/gccgo.html b/_content/doc/install/gccgo.html
index 3974cad..9b85839 100644
--- a/_content/doc/install/gccgo.html
+++ b/_content/doc/install/gccgo.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Setting up and using gccgo"
+ "Title": "Setting up and using gccgo",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/install/source.html b/_content/doc/install/source.html
index a746dc7..8d9a46d 100644
--- a/_content/doc/install/source.html
+++ b/_content/doc/install/source.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Installing Go from source"
+ "Title": "Installing Go from source",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/add-a-test.html b/_content/doc/tutorial/add-a-test.html
index 7dc5d80..3e6fb18 100644
--- a/_content/doc/tutorial/add-a-test.html
+++ b/_content/doc/tutorial/add-a-test.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Add a test"
+ "Title": "Add a test",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/call-module-code.html b/_content/doc/tutorial/call-module-code.html
index fa4628a..16b1f40 100644
--- a/_content/doc/tutorial/call-module-code.html
+++ b/_content/doc/tutorial/call-module-code.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Call your code from another module"
+ "Title": "Call your code from another module",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/compile-install.html b/_content/doc/tutorial/compile-install.html
index 330f645..4ed06f1 100644
--- a/_content/doc/tutorial/compile-install.html
+++ b/_content/doc/tutorial/compile-install.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Compile and install the application"
+ "Title": "Compile and install the application",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/create-module.html b/_content/doc/tutorial/create-module.html
index 903a3da..094f254 100644
--- a/_content/doc/tutorial/create-module.html
+++ b/_content/doc/tutorial/create-module.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Create a Go module"
+ "Title": "Tutorial: Create a Go module",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/database-access.md b/_content/doc/tutorial/database-access.md
index 92fa2ec..f82e8b0 100644
--- a/_content/doc/tutorial/database-access.md
+++ b/_content/doc/tutorial/database-access.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Accessing a relational database"
+ "Title": "Tutorial: Accessing a relational database",
+ "Breadcrumb": true
}-->
This tutorial introduces the basics of accessing a relational database with
diff --git a/_content/doc/tutorial/fuzz.md b/_content/doc/tutorial/fuzz.md
index f598c06..13f9085 100644
--- a/_content/doc/tutorial/fuzz.md
+++ b/_content/doc/tutorial/fuzz.md
@@ -1,6 +1,7 @@
<!--{
"Title": "Tutorial: Getting started with fuzzing",
- "HideTOC": true
+ "HideTOC": true,
+ "Breadcrumb": true
}-->
This tutorial introduces the basics of fuzzing in Go. With fuzzing, random data
diff --git a/_content/doc/tutorial/generics.md b/_content/doc/tutorial/generics.md
index c773b04..51dd45d 100644
--- a/_content/doc/tutorial/generics.md
+++ b/_content/doc/tutorial/generics.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Getting started with generics"
+ "Title": "Tutorial: Getting started with generics",
+ "Breadcrumb": true
}-->
This tutorial introduces the basics of generics in Go. With generics, you can
diff --git a/_content/doc/tutorial/getting-started.html b/_content/doc/tutorial/getting-started.html
index 6ca9e43..d685d8e 100644
--- a/_content/doc/tutorial/getting-started.html
+++ b/_content/doc/tutorial/getting-started.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Get started with Go"
+ "Title": "Tutorial: Get started with Go",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/greetings-multiple-people.html b/_content/doc/tutorial/greetings-multiple-people.html
index a014f82..cb04159 100644
--- a/_content/doc/tutorial/greetings-multiple-people.html
+++ b/_content/doc/tutorial/greetings-multiple-people.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Return greetings for multiple people"
+ "Title": "Return greetings for multiple people",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/handle-errors.html b/_content/doc/tutorial/handle-errors.html
index 41a0aad..baa6fe8 100644
--- a/_content/doc/tutorial/handle-errors.html
+++ b/_content/doc/tutorial/handle-errors.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Return and handle an error"
+ "Title": "Return and handle an error",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/index.html b/_content/doc/tutorial/index.html
index f696e12..76828e7 100644
--- a/_content/doc/tutorial/index.html
+++ b/_content/doc/tutorial/index.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorials"
+ "Title": "Tutorials",
+ "Breadcrumb": true
}-->
<p>If you're new to a part of Go, take a look at the tutorials linked below.</p>
diff --git a/_content/doc/tutorial/module-conclusion.html b/_content/doc/tutorial/module-conclusion.html
index dbd71eb..7f0e8e8 100644
--- a/_content/doc/tutorial/module-conclusion.html
+++ b/_content/doc/tutorial/module-conclusion.html
@@ -1,6 +1,7 @@
<!--{
"Title": "Conclusion",
- "Path": "/doc/tutorial/module-conclusion"
+ "Path": "/doc/tutorial/module-conclusion",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/random-greeting.html b/_content/doc/tutorial/random-greeting.html
index ad74681..4e9a1ed 100644
--- a/_content/doc/tutorial/random-greeting.html
+++ b/_content/doc/tutorial/random-greeting.html
@@ -1,5 +1,6 @@
<!--{
- "Title": "Return a random greeting"
+ "Title": "Return a random greeting",
+ "Breadcrumb": true
}-->
<p>
diff --git a/_content/doc/tutorial/web-service-gin.md b/_content/doc/tutorial/web-service-gin.md
index d8e163e..14e3887 100644
--- a/_content/doc/tutorial/web-service-gin.md
+++ b/_content/doc/tutorial/web-service-gin.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Developing a RESTful API with Go and Gin"
+ "Title": "Tutorial: Developing a RESTful API with Go and Gin",
+ "Breadcrumb": true
}-->
This tutorial introduces the basics of writing a RESTful web service API with Go
diff --git a/_content/doc/tutorial/workspaces.md b/_content/doc/tutorial/workspaces.md
index 576066f..410a630 100644
--- a/_content/doc/tutorial/workspaces.md
+++ b/_content/doc/tutorial/workspaces.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Tutorial: Getting started with multi-module workspaces"
+ "Title": "Tutorial: Getting started with multi-module workspaces",
+ "Breadcrumb": true
}-->
This tutorial introduces the basics of multi-module workspaces in Go.
diff --git a/_content/learn/index.md b/_content/learn/index.md
index 248fb92..8717bcb 100644
--- a/_content/learn/index.md
+++ b/_content/learn/index.md
@@ -1,5 +1,6 @@
---
title: "Get Started"
+breadcrumbTitle: "Learn"
---
<section class="Learn-hero">
diff --git a/_content/security/fuzz/index.md b/_content/security/fuzz/index.md
index 201c838..adf892a 100644
--- a/_content/security/fuzz/index.md
+++ b/_content/security/fuzz/index.md
@@ -1,10 +1,9 @@
---
title: Go Fuzzing
layout: article
+breadcrumb: true
---
-[Back to Go Security](/security)
-
Go supports fuzzing in its standard toolchain beginning in Go 1.18. Native Go fuzz tests are
[supported by OSS-Fuzz](https://google.github.io/oss-fuzz/getting-started/new-project-guide/go-lang/#native-go-fuzzing-support).
diff --git a/_content/security/fuzz/technical.md b/_content/security/fuzz/technical.md
index b19415c..b26b7e3 100644
--- a/_content/security/fuzz/technical.md
+++ b/_content/security/fuzz/technical.md
@@ -1,5 +1,6 @@
<!--{
- "Title": "Go Fuzzing technical details"
+ "Title": "Go Fuzzing technical details",
+ "Breadcrumb": true
}-->
This document provides an overview of the technical details of the native fuzzing implementation, and is intended to be a resource for contributors.
diff --git a/_content/security/policy.md b/_content/security/policy.md
index 23ad88c..ae76cc0 100644
--- a/_content/security/policy.md
+++ b/_content/security/policy.md
@@ -1,10 +1,9 @@
---
title: Go Security Policy
layout: article
+breadcrumb: true
---
-[Back to Go Security](/security)
-
## Overview
This document explains the Go Security team's process for handling issues
diff --git a/_content/site.tmpl b/_content/site.tmpl
index df0fc20..5b5ea62 100644
--- a/_content/site.tmpl
+++ b/_content/site.tmpl
@@ -270,21 +270,19 @@
{{- if ne .p1.URL "/"}}
{{- breadcrumbnav (page (path.Dir (strings.TrimRight .p1.URL "/"))) .p2}}
{{- end}}
-{{- if not (eq .p1.title "go.dev")}}
+{{- if not (eq .p1.title "The Go Programming Language")}}
<li class="BreadcrumbNav-li {{if eq .p1.URL .p2.URL}}active{{end}}">
<a class="BreadcrumbNav-link" href="{{.p1.URL}}">
- {{or .p1.company .p1.title}}
+ {{or .p1.breadcrumbTitle .p1.title}}
</a>
</li>
{{- end}}
{{- end}}
{{define "breadcrumbs"}}
-<div class="BreadcrumbNav">
- <ol class="BreadcrumbNav-inner">
- {{breadcrumbnav . .}}
- </ol>
-</div>
+<ol class="SiteBreadcrumb">
+ {{breadcrumbnav . .}}
+</ol>
{{- end}}
{{define "gopher info" -}}
@@ -422,6 +420,11 @@
<div class="Article-columns">
<div class="Article-content">
{{end}}
+
+{{if .breadcrumb}}
+ {{ breadcrumbs . }}
+{{end}}
+
{{if .title}}
<h1>{{.title}}</h1>
{{else if eq .layout "error"}}
diff --git a/_content/solutions/index.md b/_content/solutions/index.md
index a8f6904..7ae4eb5 100644
--- a/_content/solutions/index.md
+++ b/_content/solutions/index.md
@@ -8,6 +8,7 @@
<div class="GoCarousel" id="SolutionsHeroCarousel-carousel">
<div class="GoCarousel-controlsContainer">
<div class="GoCarousel-wrapper SolutionsHeroCarousel-wrapper">
+ {{ breadcrumbs . }}
<ul class="js-solutionsHeroCarouselSlides SolutionsHeroCarousel-slides">
{{- $n := 0}}
{{- range newest $solutions}}