{{ define "main" }}

<h1>
    {{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
    {{ .Title | markdownify }}
    <span class="rss-link">
        {{ with .OutputFormats.Get "rss" }}
        <a href="{{ .Permalink }}">{{ partial "icon.html" "rss-feed" }}</a>
        {{ end }}
    </span>
</h1>

<div class="sections">
    {{ range .Sections }}

    <a class="section-anchor" href="{{ .Permalink }}">
        <div class="section">
                <h2 class="section-title">
                    {{ with .Params.icon }}{{ partial "icon.html" . }}{{ end }}
                    {{ .Title | markdownify }}
                </h2>

                <div class="section-description">
                    {{ if .Description }}
                    <p>
                        {{ .Description | markdownify }}
                    </p>
                    {{ else }}
                    {{ .Summary }}
                    {{ end }}
                </div>
        </div>
    </a>

    {{ end }}
</div>

<div class="posts">
    {{ range .Paginator.Pages }}
        {{ .Render "summary" }}
    {{ else }}
        {{ i18n "no_posts" }}
    {{ end }}
</div>

{{ if gt .Paginator.TotalPages 1 }}
<div class="pagination">
    {{ template "_internal/pagination.html" . }}
</div>
{{ end }}

{{ end }}