content: use PageType in _unit_header.tmpl and unit_details.tmpl

Instead of computing the page type using .Unit methods, use the already
computed page type in these templates.

Change-Id: I7b724b7ca64027aa6a2defbc6d806f6afaa1e095
Reviewed-on: https://go-review.googlesource.com/c/pkgsite/+/261719
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>
This commit is contained in:
Julie Qiu 2020-10-12 15:02:18 -04:00
Родитель bc5ab13a65
Коммит 98487e695c
2 изменённых файлов: 3 добавлений и 10 удалений

Просмотреть файл

@ -6,11 +6,7 @@
{{define "unit_header"}}
<header class="UnitHeader" role="complementary"
aria-label="{{if .Unit.IsCommand}}command
{{else if .Unit.IsPackage}}package
{{else if .Unit.IsModule}}module
{{else}}directory{{end}}
{{.Title}} information">
aria-label="{{if eq .PageType "std"}}module{{else}}{{.PageType}}{{end}} {{.Title}} information">
<div class="UnitHeader-container">
<div class="UnitHeader-breadcrumb">
{{with .Breadcrumb}}

Просмотреть файл

@ -12,11 +12,8 @@
<div class="UnitDetails">
{{.MobileOutline}}
<div class="UnitDetails-outline" role="navigation"
aria-label="{{if .Unit.IsCommand}}command
{{else if .Unit.IsPackage}}package
{{else if .Unit.IsModule}}module
{{else}}directory{{end}}
details navigation">
aria-label="{{if eq .PageType "std"}}module
{{else}}{{.PageType}}{{end}}details navigation">
{{block "unit_outline" .}}{{end}}
</div>
<div class="UnitDetails-content" role="main">