if STATUSES.merchandisable
  h2.artist-section-header Books & Catalogs for purchase
  #artist-page-merchandisable-section.merchandisable-items
    if books.length
      for book in books
        a.merchandisable-item( href= book.get('external_url'), target='_blank' )
          .merchandisable-item-image: img(
            src= book.cropUrlFor('image_url', { width: 175, height: 225 })
            alt= book.get('title')
          )
          .merchandisable-item-metadata
            h4.merchandisable-item-title
              = book.get('title')
            if book.has('author_name')
              .merchandisable-item-author
                | by #{book.get('author_name')}
            if book.has('publish_date')
              .merchandisable-item-publish-date(
                datetime= book.get('publish_date')
              ) (#{book.date('publish_date').format('D MMMM YYYY')})
    else
      .loading-spinner

if books.length && bibliography.length
  hr

if STATUSES.bibliography
  h2.artist-section-header
  #artist-page-bibliography-section: .loading-spinner
    //- Rendered elsewhere

if STATUSES.merchandisable
  h2.artist-section-header Books & Catalogs for purchase
  #artist-page-merchandisable-section.merchandisable-items
    if books.length
      for book in books
        a.merchandisable-item( href= book.get('external_url'), target='_blank' )
          .merchandisable-item-image: img(
            src= book.cropUrlFor('image_url', { width: 175, height: 225 })
            alt= book.get('title')
          )
          .merchandisable-item-metadata
            h4.merchandisable-item-title
              = book.get('title')
            if book.has('author_name')
              .merchandisable-item-author
                | by #{book.get('author_name')}
            if book.has('publish_date')
              .merchandisable-item-publish-date( datetime= book.get('publish_date') )
                - wholeYear = book.date('publish_date').dayOfYear() === 1
                | (#{book.date('publish_date').format(wholeYear ? 'YYYY' : 'D MMMM YYYY')})
    else
      .loading-spinner

if books.length && bibliography.length
  hr

if STATUSES.bibliography
  h2.artist-section-header
  #artist-page-bibliography-section: .loading-spinner
    //- Rendered elsewhere

Handle formatting for whole years for publication date
Handle formatting for whole years for publication date
