{{- define "title" -}}
  {{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}
  {{- if .Site.Params.withSiteTitle }} {{ .Site.Params.titleDelimiter }} {{ .Site.Title }}{{- end -}}
{{- end -}}

{{- define "content" -}}
  {{- $params := partial "function/params.html" -}}
  <article class="page single special friends">
    <div class="header">
      {{- /* Title */ -}}
      <h1 class="single-title animate__animated animate__pulse animate__faster">{{- cond (.Param "capitalizeTitles") (title .Title) .Title -}}</h1>
      {{- /* Subtitle */ -}}
      {{- with $params.subtitle -}}<p class="single-subtitle animate__animated animate__fadeIn">{{ . | $.RenderString }}</p>{{- end -}}
    </div>

    {{- /* Friend links */ -}}
    <script src="//at.alicdn.com/t/font_578712_g26jo2kbzd5qm2t9.js" async defer></script>
    <div class="friend-links">
      {{ range $index, $friend := hugo.Data.friends }}
        <a class="friend-link" title="{{ $friend.description | safeHTML }}" href="{{ $friend.url | safeURL }}" rel="external noopener" target="_blank">
          {{ if $friend.avatar }}
            {{- dict "Src" $friend.avatar "Alt" $friend.nickname "Title" $friend.description "Class" "friend-avatar" | partial "plugin/image.html" -}}
          {{ else }}
            <svg class="friend-avatar" aria-hidden="true">
              <use xlink:href="#icon-{{ add 1 $index }}"></use>
            </svg>
          {{ end }}
          <span class="friend-nickname" title="{{ $friend.nickname }}">@{{ $friend.nickname }}</span>
        </a>
      {{ end }}
    </div>

    {{- /* Content */ -}}
    <div class="content" id="content">
      {{- dict "Content" .Content "Ruby" $params.ruby "Fraction" $params.fraction "Fontawesome" $params.fontawesome | partial "function/content.html" | safeHTML -}}
    </div>

    {{- /* Comment */ -}}
    {{- partial "single/comment.html" . -}}
  </article>
{{- end -}}
