{{ define "main" }} {{ $elements := index (split .CurrentSection "/") }} {{ $top_section_name := index $elements (sub (len $elements) 4) }} {{ $baseSubsection := . }} {{ if eq $top_section_name .Section }} {{ $baseSubsection = .Parent }} {{ end }} {{ if not .IsSection }} {{ $baseSubsection = .Parent.Parent }} {{ end }}
{{ partial "docs/sidebar.html" . }}
{{ if isset .Params "coupling" }} {{ else if isset .Parent.Params "coupling" }} {{ end }} {{ if .Params.breadcrumbs }} {{ partial "docs/breadcrumbs.html" . }} {{ end }}

{{ .Title }}

{{ if $baseSubsection.Params.os_selector }} {{ end }}
{{ if eq .Params.toc true }}

Table of contents

{{.TableOfContents}}
{{ end }} {{ .Content }}

{{ partial "footer-nav.html" . }} {{ partial "page-info" . }}
{{ end }}