{{/*
  Copyright 2025-2026 Eugene Petrenko (mcp@jonnyzzz.com)

  Licensed under the Apache License, Version 2.0 (the "License");
  you may not use this file except in compliance with the License.
  You may obtain a copy of the License at

      http://www.apache.org/licenses/LICENSE-2.0

  Unless required by applicable law or agreed to in writing, software
  distributed under the License is distributed on an "AS IS" BASIS,
  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  See the License for the specific language governing permissions and
  limitations under the License.
*/}}
{{ define "main" }}
<div class="docs-layout">
<aside class="docs-sidebar">
    <h3>Documentation</h3>
    {{ $currentPage := . }}
    {{ $docs := site.GetPage "section" "docs" }}
    {{ $groups := slice "Getting Started" "Vision" "Reference" "Examples" }}
    {{ range $groups }}
    {{ $groupName := . }}
    {{ $groupPages := where $docs.Pages "Params.group" $groupName }}
    {{ if $groupPages }}
    <div class="sidebar-group">
        <span class="sidebar-group-label">{{ $groupName }}</span>
        <ul>
            {{ range $groupPages.ByWeight }}
            <li>
                <a href="{{ .RelPermalink }}"{{ if eq .RelPermalink $currentPage.RelPermalink }} class="active"{{ end }}>
                    {{ .Title }}
                </a>
            </li>
            {{ end }}
        </ul>
    </div>
    {{ end }}
    {{ end }}
</aside>

<article class="docs-content">
    <h1>{{ .Title }}</h1>
    {{ .Content }}
</article>
</div>
{{ end }}
