{{ define "main" }}
<div class="page">
  <div class="article-list">
    <h1 class="title">{{ .Title }}</h1>
    {{ .Content }}
    {{ $paginator := .Paginate (where .Data.Pages "Section" "!=" "") }}
    {{ range $paginator.Pages }}
    <article>
      {{ if .Params.photo }}
      <div class="article-img">
        <img src="{{ .Params.photo.url }}" alt="{{ .Params.photo.author }}" width="150px" />
      </div>
      {{ end }}
      <div class="article-body">
        <header>
          <h1 class="title"><a href="{{ .RelPermalink }}">{{ .Title }}</a></h1>
          <div class="meta">
            <div class="author">
              {{ .Params.author }}
            </div>
            <div>
              {{- range .Params.categories -}}
              <a href="{{ relURL (print "/categories/" . | urlize) }}">{{ . }}</a>
              {{ end -}}
            </div>
          </div>
        </header>
        {{ if .Params.summary }}{{ .Params.summary }}{{ else }}{{ .Summary }}{{ end }}

        {{ if .Truncated }}
        <a href="{{ .RelPermalink }}">Devamını okuyun...</a>
        {{ end }}
        <footer>
          <time datetime="{{ .Date.Format "2006-1-2" | safeHTML }}">{{ .Date.Format "2006/01/02" }}</time>
        </footer>
      </div>
    </article>
    {{ end }}
    {{ template "_internal/pagination.html" . }}
  </div>
  <aside class="sidebar">
    <h2 class="title">{{ i18n "kategoriler" }}</h2>
    <nav class="categories">
    <!-- {{ range $key, $value := .Site.Taxonomies.categories }}                        -->
    <!--   <a href="{{ (print "/categories/" $key | urlize) | relURL }}">{{ $key }}</a> -->
    <!-- {{ end }}                                                                      -->

      {{ range .Site.Menus.categories }}
      <div  style="background-image: url({{ .Pre }})">
        <a href="{{ .URL }}">
          {{ .Name }}
        </a>
      </div>
      {{ end }}
    </nav>
    <h2>{{ i18n "etkinlikler" }}</h2>
    {{ partial "events" . }}
  </aside>
</div>
{{ end }}
