18F/18f.gsa.gov

View on GitHub
_includes/post-author.html

Summary

Maintainability
Test Coverage
<p class="post-byline">
{% if include.context == 'page' and page.authors %}
  {% assign authors = page.authors %}
{% elsif include.context == 'post' and post.authors %}
  {% assign authors = post.authors | to_yaml %}
{% endif %}
  By
  {% for author in authors %}
    <span itemprop="author" itemscope itemtype="http://schema.org/Person">
        {{ author | team_link }}
    </span>
    {% assign authorCount = authors | size %}
    {% if authorCount > 1 %}
      {% unless forloop.last %}
        <span class="post-author-comma">,</span>
      {% endunless %}
    {% endif %}
  {% endfor %}
</p>