{{/*
  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-header">
    <h1>Documentation</h1>
    <p>Learn how to install, configure, and use MCP Steroid with your AI Agents.</p>
</div>

{{ $docs := site.GetPage "section" "docs" }}
{{ $groups := slice "Getting Started" "Vision" "Reference" "Examples" }}

<div class="docs-groups">
    {{ range $groups }}
    {{ $groupName := . }}
    {{ $groupPages := where $docs.Pages "Params.group" $groupName }}
    {{ if $groupPages }}
    <div class="docs-group-section">
        <h2 class="docs-group-heading">{{ $groupName }}</h2>
        <div class="docs-grid">
            {{ range $groupPages.ByWeight }}
            <a href="{{ .RelPermalink }}" class="doc-card">
                <h3>{{ .Title }}</h3>
                {{ $desc := .Description | plainify }}
                {{ if not $desc }}{{ $desc = .Summary | plainify }}{{ end }}
                {{ if not $desc }}{{ $desc = .Plain | truncate 160 }}{{ end }}
                <p>{{ $desc }}</p>
                <span class="arrow">Read more &rarr;</span>
            </a>
            {{ end }}
        </div>
    </div>
    {{ end }}
    {{ end }}
</div>
{{ end }}
