{{ $item := .item }}
{{ $year_value := $item.Params.event_start | default $item.Date }}
{{ $year := (time $year_value).Format "2006" }}
{{ $has_attachments := partial "functions/has_attachments" $item }}

<div class="pub-list-item view-citation" style="margin-bottom: 1rem">
  <i class="far fa-file-alt pub-icon" aria-hidden="true"></i>

  {{/* APA Style */}}
  {{ if eq (site.Params.hugoblox.content.citations.style | default "apa") "apa" }}

  <span class="article-metadata li-cite-author">
    {{ partial "page_metadata_authors" $item }}
  </span>
  ({{- $year -}}).
  <a href="{{ $item.RelPermalink }}" class="underline">{{ $item.Title }}</a>.
  {{ if $item.Params.publication_short }}
    {{- $item.Params.publication_short | markdownify -}}.
  {{ else if $item.Params.publication }}
    {{- $item.Params.publication | markdownify -}}.
  {{ end }}

  {{ if $has_attachments }}
  <div class="flex flex-wrap space-x-3">
    {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  </div>
  {{ end }}

  {{/* MLA Style */}}
  {{ else }}

  <span class="article-metadata li-cite-author">
    {{ partial "page_metadata_authors" $item }}.
  </span>
  <a href="{{ $item.RelPermalink }}">{{ $item.Title }}</a>.
  {{ if $item.Params.publication_short }}
    {{- $item.Params.publication_short | markdownify -}},
  {{ else if $item.Params.publication }}
    {{- $item.Params.publication | markdownify -}},
  {{ end }}
  {{- $year -}}.

  {{ if $has_attachments }}
  <div class="flex flex-wrap space-x-3">
    {{ partial "page_links" (dict "page" $item "is_list" 1) }}
  </div>
  {{ end }}

  {{ end }}
</div>
