{{ define "main" }}
{{ partial "greeter.html" .}}
<header id="homepage-header" class="homepage-header">
  <div class="flex-wrap-container" style="align-items:center">
    {{ $logo := (resources.Get "/img/logo.png").Resize "100x100" }}
    <a href="/">
      <img style="padding-right: 1%" src="{{ $logo.RelPermalink }}" alt="logo">
    </a>
    <a style="text-decoration: none" href="/">
      <h1 style="display:inline; color:var(--primary)">{{.Title}}</h1> 
    </a>
    <span style="margin-left: auto;">
    {{ range .Site.Sections.Reverse }}
      <a href="{{ .Permalink }}"><h4 style="display: inline-block; padding-left:.375em;padding-right:.375em;">{{ .Title }}</h4></a>
    {{ end }}
    </span>
    {{ $rss := (resources.Get "/img/rss.png").Resize "30x30" }}
    <a type="application/rss+xml" href="/blog/index.xml" target="_blank">
      <img style="padding-right: 1em" src="{{ $rss.RelPermalink }}" alt="rss icon">
    </a>
  </div>
</header>

<main>
  <div class="flex-wrap-container">
    <div class="container">
      <h2>Projects</h2>
      <hr>
      {{- $pageLen := len (where .Site.RegularPages "Type" "projects") -}}
      {{- range $i, $element := (where .Site.RegularPages "Type" "projects") }}
      {{ .Render "summary" }}
      {{- if lt $i (sub $pageLen 1) }} <hr> {{ end -}}
      {{- end }}
    </div>

    <div class="container-no-bg">
      <div class="container">
        <h2>Blog</h2>
        <hr>
        {{- $pageLen := len (where .Site.RegularPages "Type" "blog") -}}
        {{- range $i, $element := (where .Site.RegularPages "Type" "blog") }}
        {{ .Render "summary" }}
        {{- if lt $i (sub $pageLen 1) }} <hr> {{ end -}}
        {{- end }}
      </div>

      <div class="container">
        <h2>Research Papers</h2>
        <hr>
        {{- $pageLen := len (where .Site.RegularPages "Type" "research papers") -}}
        {{- range $i, $element := (where .Site.RegularPages "Type" "research papers") }}
        {{ .Render "summary" }}
        {{- if lt $i (sub $pageLen 1) }} <hr> {{ end -}}
        {{- end }}
      </div>
    </div>

  </div>
</main>

{{ end }}
