{{- /* Get parameters */ -}} {{- $currentPage := .currentPage -}} {{- $nodes := .nodes -}} {{- $version := .version | default "opensource" -}} {{- define "walk" }} {{- $currentPage := .currentPage -}} {{- $node := .node -}} {{- $version := .version -}} {{- /* Skip node if it has a Page with an audience that does not match version */ -}} {{- $skip := false -}} {{- with $node.Page }} {{- $audience := .Params.audience -}} {{- if and $audience (ne $audience $version) }} {{- $skip = true -}} {{- end }} {{- end }} {{- if not $skip }} {{- $linkContent := $node.Page.LinkTitle -}} {{- with $node.Name }} {{- $linkContent = . }} {{- end }} {{- /* Pro badge for parent pages (from _index.md with child pages) marked audience: pro */ -}} {{- $proBadge := "" -}} {{- with $node.Page }} {{- if and (eq .Params.audience "pro") .Pages }} {{- $proBadge = `Pro` -}} {{- end }} {{- end }} {{- $ariaCurrent := "" -}} {{- $liClass := "" -}} {{- if $node.Page }} {{- if in $currentPage.Ancestors $node.Page }} {{- $ariaCurrent = "true" }} {{- end }} {{- if $currentPage.Eq $node.Page }} {{- $ariaCurrent = "page" }} {{- $liClass = "active" }} {{- end }} {{- end }}