Improve breadcrumb example (#2026)

This commit is contained in:
Joe Mooring 2023-03-25 07:01:44 -07:00 committed by GitHub
parent 6148be2dec
commit fc0ecc027c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -63,14 +63,18 @@ If you need a specific template for a sub-section, you need to adjust either the
With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation: With the available [section variables and methods](#section-page-variables-and-methods) you can build powerful navigation. One common example would be a partial to show Breadcrumb navigation:
{{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}} {{< code file="layouts/partials/breadcrumb.html" download="breadcrumb.html" >}}
<ul class="nav navbar-nav"> <nav aria-label="breadcrumb">
{{- range .Ancestors.Reverse }} <ol>
<li><a href="{{ .Permalink }}">{{ .Title }}</a></li> {{ range .Ancestors.Reverse }}
{{- end }} <li>
<li class="active" aria-current="page"> <a href="{{ .Permalink }}">{{ .LinkTitle }}</a>
<a href="{{ .Permalink }}">{{ .Title }}</a> </li>
</li> {{ end }}
</ul> <li class="active">
<a aria-current="page" href="{{ .Permalink }}">{{ .LinkTitle }}</a>
</li>
</ol>
</nav>
{{< /code >}} {{< /code >}}
## Section Page Variables and Methods ## Section Page Variables and Methods