- longDate = 'dddd Do, MMMM YYYY [at] HH:mm'
- when = moment(article.publication)
- whenText = when.format(longDate)
- modified = moment(article.updated)
- created = moment(article.created)
- published = article.status === 'published'

article.at-article.ly-section(itemscope, itemtype='http://schema.org/BlogPosting')
  meta(itemprop='dateCreated', content=created.format())
  meta(itemprop='datePublished', content=when.format())
  meta(itemprop='dateModified', content=modified.format())
  meta(itemprop='keywords', content=article.tags.join(','))
  meta(itemprop='discussionUrl', content=env.authority + article.permalink + '#comments')

  - cc = article.commentCount
  if cc
    meta(itemprop='interactionCount', content=cc + ' UserComments')

  header.at-header.uv-clearfix
    h1.at-title
      a.at-title-link(href=article.permalink, aria-label='Tagged: ' + article.tags.join(', '), itemprop='headline')=article.title

    if cc
      a.uv-left.mm-count(href='#comments')='(' + cc + ' comment' + (cc === 1 ? ')' : 's)')

    span.at-meta
      span='reading time: '
      time(aria-label='You\'re probably faster than that!')=moment.duration(article.readingTime, 'seconds').humanize()
      span=', ' + article.status + ' '
      if article.status !== 'draft'
        time(aria-label='Published ' + whenText, datetime=when.format())=when.fromNow()

  section.at-corpus(itemprop='articleBody')
    section.md-markdown.at-teaser(itemprop='about')!=article.teaserHtml

    if full
      section.md-markdown.at-body!=article.bodyHtml
    else
      section.at-full
        a.at-full-button(href=article.permalink, aria-label='Quality content awaits!') Read the full article

  footer
    include ../partials/tags

    if full
      if article.related.length
        section.at-related
          p.at-related-header Browse related articles!
          ul
            each related in article.related
              li.at-related-item
                a(href='/articles/' + related.slug, aria-label='Read the article!')=related.title

      section.at-siblings.uv-clearfix
        if article.prev
          a.at-prev(href='/articles/' + article.prev.slug, rel='prev', aria-label='Read the previous article!')
            span.at-prev-anchor='« '
            span.at-prev-text=article.prev.title

        if article.next
          a.at-next.hint-before(href='/articles/' + article.next.slug, rel='next', aria-label='Read the next article!')
            span.at-next-text=article.next.title
            span.at-next-anchor=' »'

if published && full
  include comments
