internal/godoc/dochtml: display header and remove package files

The header for each documentation section is now always displayed on the
unit page, even when there is no content for that section.

The package files section is removed from the dochtml template. The
package files will be render directly in
content/static/html/pages/unit_details.tmpl in a follow up CL.

Change-Id: I9e4853c2869829e01cc458e69dd60853e3513107
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/259003
Trust: Julie Qiu <julie@golang.org>
Run-TryBot: Julie Qiu <julie@golang.org>
TryBot-Result: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jamal Carvalho <jamal@golang.org>
diff --git a/internal/godoc/dochtml/template_body.go b/internal/godoc/dochtml/template_body.go
index 2cbb342..56bda15 100644
--- a/internal/godoc/dochtml/template_body.go
+++ b/internal/godoc/dochtml/template_body.go
@@ -61,9 +61,9 @@
 	</section>
 	{{- end -}}
 
+	<h3 tabindex="-1" id="pkg-constants" class="Documentation-constantsHeader">Constants <a href="#pkg-constants">¶</a></h3>{{"\n"}}
 	{{- if .Consts -}}
 	<section class="Documentation-constants">
-		<h3 tabindex="-1" id="pkg-constants" class="Documentation-constantsHeader">Constants <a href="#pkg-constants">¶</a></h3>{{"\n"}}
 		{{- range .Consts -}}
 			{{- $out := render_decl .Doc .Decl -}}
 			{{- $out.Decl -}}
@@ -73,9 +73,9 @@
 	</section>
 	{{- end -}}
 
+	<h3 tabindex="-1" id="pkg-variables" class="Documentation-variablesHeader">Variables <a href="#pkg-variables">¶</a></h3>{{"\n"}}
 	{{- if .Vars -}}
 	<section class="Documentation-variables">
-		<h3 tabindex="-1" id="pkg-variables" class="Documentation-variablesHeader">Variables <a href="#pkg-variables">¶</a></h3>{{"\n"}}
 		{{- range .Vars -}}
 			{{- $out := render_decl .Doc .Decl -}}
 			{{- $out.Decl -}}
@@ -85,6 +85,7 @@
 	</section>
 	{{- end -}}
 
+	<h3 tabindex="-1" id="pkg-functions" class="Documentation-functionsHeader">Functions <a href="#pkg-functions">¶</a></h3>{{"\n"}}
 	{{- if .Funcs -}}
 	<section class="Documentation-functions">
 		{{- range .Funcs -}}
@@ -101,6 +102,7 @@
 	</section>
 	{{- end -}}
 
+	<h3 tabindex="-1" id="pkg-types" class="Documentation-typesHeader">Types <a href="#pkg-types">¶</a></h3>{{"\n"}}
 	{{- if .Types -}}
 	<section class="Documentation-types">
 		{{- range .Types -}}
@@ -159,15 +161,6 @@
 		</div>
 		{{- end -}}
 	</section>
-
-	<section class="Documentation-files">
-		<h3 tabindex="-1" id="pkg-files" class="Documentation-filesHeader">Package Files <a href="#pkg-files">¶</a></h3>
-		<ul class="Documentation-filesList">
-			{{- range .Filenames -}}
-				<li>{{file_link .}}</li>
-			{{- end -}}
-		</ul>
-	</section>
 	{{- end -}}
 {{- end -}}
 
diff --git a/internal/godoc/dochtml/template_sidenav.go b/internal/godoc/dochtml/template_sidenav.go
index 976bbdf..cc3e041 100644
--- a/internal/godoc/dochtml/template_sidenav.go
+++ b/internal/godoc/dochtml/template_sidenav.go
@@ -17,24 +17,12 @@
 				<li class="DocNav-index" role="none">
 					<a href="#pkg-index" role="treeitem" aria-level="1" tabindex="0">Index</a>
 				</li>
-			{{end}}
-			{{if .Examples.List}}
-				<li class="DocNav-examples" role="none">
-					<a href="#pkg-examples" role="treeitem" aria-level="1" tabindex="-1">Examples</a>
-				</li>
-			{{end}}
-			{{if .Consts}}
 				<li class="DocNav-constants" role="none">
 					<a href="#pkg-constants" role="treeitem" aria-level="1" tabindex="-1">Constants</a>
 				</li>
-			{{end}}
-			{{if .Vars}}
 				<li class="DocNav-variables" role="none">
 					<a href="#pkg-variables" role="treeitem" aria-level="1" tabindex="-1">Variables</a>
 				</li>
-			{{end}}
-
-			{{if .Funcs}}
 				<li class="DocNav-functions" role="none">
 					<span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-functions" tabindex="-1">Functions</span>
 					<ul role="group" id="nav-group-functions">
@@ -45,9 +33,6 @@
 						{{end}}
 					</ul>
 				</li>
-			{{end}}
-
-			{{if .Types}}
 				<li class="DocNav-types" role="none">
 					<span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-types" tabindex="-1">Types</span>
 					<ul role="group" id="nav-group-types">
@@ -77,9 +62,6 @@
 						{{end}} {{/* range .Types */}}
 					</ul>
 				</li>
-			{{end}}
-
-			{{if .Notes}}
 				<li class="DocNav-notes" role="none">
 					<span class="DocNav-groupLabel" role="treeitem" aria-expanded="true" aria-level="1" aria-owns="nav-group-notes" tabindex="-1">Notes</span>
 					<ul role="group" id="nav-group-notes">
@@ -91,12 +73,6 @@
 					</ul>
 				</li>
 			{{end}}
-
-			{{if .Filenames}}
-				<li class="DocNav-files" role="none">
-					<a href="#pkg-files" role="treeitem" aria-level="1" tabindex="-1">Package Files</a>
-				</li>
-			{{end}}
 		</ul>
 	</nav>
 	` + IdentifierSidenavMobileStart + `