{{ define "main" }}

  <main aria-role="main">
  <header class="homepage-header">
    <h1>{{.Title}}</h1>
    {{ with .Params.subtitle }}
    <span class="subtitle">{{.}}</span>
    {{ end }}
  </header>
  <div class="homepage-content">
    <!-- Note that the content for index.html, as a sort of list page, will pull from content/_index.md -->
    {{.Content}}
  </div>
  <div>
    {{ range first 10 .Site.RegularPages }}
        {{ .Render "summary"}}
    {{ end }}
  </div>
  </main>

{{ $pages := where site.RegularPages "Type" "in" site.Params.mainSections }}
{{ range $pages.ByPublishDate.Reverse }}
  <p>
    <a href="{{ .Permalink }}">{{ .Title | markdownify }}</a>
    {{ $customDateFormat := "January 2, 2006" }}
    {{ with .Site.Params.customDateFormat }}{{ $customDateFormat = . }}{{ end }}
    <br>
    <small class="text-secondary">{{ .PublishDate.Format $customDateFormat }}</small>
    {{ partial "tags" . }}
    {{ if eq .Site.Params.showPostSummary true }}
    <br>
    {{ .Summary }}
    {{ end }}
  </p>
{{ end }}

{{ end }}