{{/* Discreet navigation between the documents of a single release. Every release ships a different set of documents, so the list is not hardcoded: it holds the documents the release index page links to. Following the index keeps this in step with the documents of an upcoming release, which are committed well before they are announced and are deliberately left out of the index until then. Only the documents of the modern release layout are listed; the per-architecture pages of the old releases (hardware-i386, relnotes-alpha, ...) and one-off pages (todo, qa, approvals, ...) are ignored. The partial renders nothing unless the page is a document of a release directory holding its own _index.adoc, which is the case from 10.2R on, and the index links at least one other document. */}} {{- $ordered := slice "announce" "signatures" "upgrading" "installation" "hardware" "relnotes" "errata" "readme" "schedule" -}} {{- $page := . -}} {{- with $page.File -}} {{- $dir := .Dir -}} {{- if findRE `^releases/[^/]+/?$` $dir -}} {{- $section := $page.CurrentSection -}} {{- with $section.File -}} {{- if eq .Dir $dir -}} {{- /* The documents the release index page links to, by base name. */ -}} {{- $linked := slice -}} {{- range findRE `href="[^"]+"` $section.Content -}} {{- $href := . | strings.TrimPrefix `href="` | strings.TrimSuffix `"` | strings.TrimSuffix "/" -}} {{- $linked = $linked | append (path.Base $href) -}} {{- end -}} {{- $documents := slice -}} {{- $others := false -}} {{- range $name := $ordered -}} {{- if in $linked $name -}} {{- range $sibling := $section.RegularPages -}} {{- with $sibling.File -}} {{- if eq .TranslationBaseName $name -}} {{- $documents = $documents | append (dict "key" $name "page" $sibling) -}} {{- if ne $sibling.RelPermalink $page.RelPermalink -}} {{- $others = true -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- $release := $dir | strings.TrimPrefix "releases/" | strings.TrimSuffix "/" | strings.TrimSuffix "R" -}} {{- if $others -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}} {{- end -}}