extends layouts/main-sidebar
block content

  include post/components/list-item
  include post/components/featured-item

  if site.featuredEmbed
    .content-block!= site.featuredEmbed

  if Array.isArray(featuredPosts) && (featuredPosts.length > 0)
    .uk-margin
      +renderSectionTitle('Featured Posts')
    .content-block.uk-border-rounded
      - var topPost = featuredPosts.shift();
      .uk-margin
        +renderBlogPostFeaturedItem(topPost)

      if (featuredPosts.length > 0)
        .uk-margin
          div(uk-grid).uk-grid-small
            each post in featuredPosts
              div(class="uk-width-1-1 uk-width-1-2@s")
                +renderBlogPostFeaturedItem(post)

  //- Blog Posts
  .uk-margin-large
    +renderSectionTitle(`${site.name} Posts`)
    if Array.isArray(posts) && (posts.length > 0)
      - var postIndex = 1;
      ul.uk-list.uk-list-small
        each post in posts
          li
            .content-block.uk-border-rounded
              +renderBlogPostListItem(post, postIndex, 4)
          - postIndex += 1;
    else
      div There are no posts at this time. Please check back later!
