{{/* Author profile page. */}}

{{ partial "header.html" . }}
{{ partial "navbar.html" . }}

{{/* If an account has not been created for this user, just display their name as the title. */}}
{{ if not .File }}
<div class="universal-wrapper pt-3">
  <h1 itemprop="name">{{ .Title }}</h1>
</div>
{{ end }}

<section id="profile-page" class="pt-5">
  <div class="container">
    {{/* Show the About widget if an account exists for this user. */}}
    {{ if .File }}
      {{ $widget := "widgets/about.html" }}
      {{ $slug := delimit (last 1 (split (trim .File.Dir "/") "/")) "" }}{{/* Alternatively, use `index .Params.authors 0` */}}
      {{ $params := dict "root" $ "page" . "author" $slug }}
      {{ partial $widget $params }}
    {{end}}

    {{ $query := where .Pages ".IsNode" false }}
    {{ $count := len $query }}
    {{ if $count }}
    <div class="article-widget">
      <div class="hr-light"></div>
      <h3>{{ i18n "user_profile_latest" | default "Latest" }}</h3>
      <ul>
        {{ range $query }}
        <li>
          <a href="{{ .RelPermalink }}">{{ .Title }}</a>
        </li>
        {{ end }}
      </ul>
    </div>
  </div>
  {{ end }}
</section>

{{ partial "footer_container.html" . }}
{{ partial "footer.html" . }}
