{{ 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 }} {{/* "block md:hidden" only shows on small screen sizes */}}
Table of Contents (click to toggle)
{{.TableOfContents}}
{{ end }}
{{ .Content }}

{{ partial "footer-nav.html" . }} {{ partial "page-info" . }}
{{ if eq .Params.toc true }} {{/* "hidden md:flex" hides on small screen sizes */}} {{ end }}
{{ end }}