{{ $is_list := .is_list }}
{{ $ := .content }}
<div class="article-metadata">

  {{/* If `authors` is set and is not empty. */}}
  {{ if $.Params.authors }}
  {{ $authorLen := len $.Params.authors }}
  <div>
    {{ range $k, $v := $.Params.authors -}}
    <span itemscope itemprop="author" itemtype="http://schema.org/Person">
      <span itemprop="name">{{- $v | markdownify -}}</span>
    </span>
    {{- if lt $k (sub $authorLen 1) -}}, {{ end }}
    {{ end }}
  </div>
  {{ else }}
  <span itemscope itemprop="author" itemtype="http://schema.org/Person">
    <meta itemprop="name" content="{{ $.Site.Params.name }}">
  </span>
  {{ end }}

  <span class="article-date">
    {{ if ne $.Params.Lastmod $.Params.Date }}
        {{ i18n "last_updated" }}
    {{ end }}
    <meta content="{{ $.Params.Date }}" itemprop="datePublished">
    <time datetime="{{ $.Params.LastMod }}" itemprop="dateModified">
      {{ $.Lastmod.Format $.Site.Params.date_format }}
    </time>
  </span>
  <span itemscope itemprop="publisher" itemtype="http://schema.org/Person">
    <meta itemprop="name" content="{{ $.Site.Params.name }}">
  </span>

  {{ if and (eq $.Type "post") (not (or (eq $.Site.Params.reading_time false) (eq $.Params.reading_time false))) }}
  <span class="middot-divider"></span>
  <span class="article-reading-time">
    {{ $.ReadingTime }} {{ i18n "minute_read" }}
  </span>
  {{ end }}

  {{ $comments_enabled := and $.Site.DisqusShortname (not (or $.Site.Params.disable_comments (eq $.Params.comments false))) }}
  {{ if and $comments_enabled ($.Site.Params.comment_count | default true) }}
  <span class="middot-divider"></span>
  <a href="{{ $.RelPermalink }}#disqus_thread"><!-- Count will be inserted here --></a>
  {{ end}}

  {{ if $.Params.categories }}
  {{ $categoriesLen := len $.Params.categories }}
  {{ if gt $categoriesLen 0 }}
  <span class="middot-divider"></span>
  <span class="article-categories">
    <i class="fas fa-folder"></i>
    {{ range $k, $v := $.Params.categories }}
    <a href="{{ ($.Site.GetPage (printf "categories/%s" .)).RelPermalink }}">{{ . }}</a>
    {{- if lt $k (sub $categoriesLen 1) -}}, {{ end }}
    {{ end }}
  </span>
  {{ end }}
  {{ end }}

  {{ if ne $is_list 1 }}
  {{ partial "share.html" $ }}
  {{ end }}

</div>
