<!-- Page Header -->
<!-- Set your background image for this header in your post front-matter: cover -->
<%
    var cover = item.cover || theme.index_cover;
%>
<header class="intro-header" style="background-image: url('<%- url_for(cover) %>')">
    <div class="container">
        <div class="row">
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <div class="post-heading">
                    <h1><%- item.title || theme.default_post_title || "Untitled" %></h1>
                    <% if (item.subtitle && item.subtitle.length) { %>
                    <h2 class="post-subheading">
                        <%- item.subtitle %>
                    </h2>
                    <% } %>
                    <span class="meta">
                        <!-- Date and Author -->
                        <% if(item.author) { %>
                            Posted by <%- item.author %> on
                        <% } %>
                        <% if(item.date) { %>
                            <%= item.date.format(config.date_format) %>
                        <% } %>
                    </span>
                </div>
            </div>
        </div>
    </div>
</header>

<!-- Post Content -->
<article>
    <div class="container">
        <div class="row">

            <!-- Tags and categories -->
           <% if (item.categories && item.categories.length || item.tags && item.tags.length) { %>
                <div class="col-lg-4 col-lg-offset-2 col-md-5 col-md-offset-1 post-tags">
                    <% if (item.tags && item.tags.length){ %>
                        <%- partial('article-tags', {item: item}) %>
                    <% } else { %>
                        <%- partial('article-categories', {item: item}) %>
                    <% } %>
                </div>
                <div class="col-lg-4 col-md-5 post-categories">
                    <% if (item.tags && item.tags.length && item.categories && item.categories.length){ %>
                        <%- partial('article-categories', {item: item}) %>
                    <% } %>
                </div>
            <% } %>

            <!-- Gallery -->
            <% if (item.photos && item.photos.length){ %>
                <%- partial('gallery') %>
            <% } %>

            <!-- Post Main Content -->
            <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                <%- item.content %>

                <% if(theme.addthis) { %>
                    <!-- Go to www.addthis.com/dashboard to customize your tools -->
                    <script type="text/javascript" src="//s7.addthis.com/js/300/addthis_widget.js#pubid=<%- theme.addthis %>"></script>

                    <!-- Go to www.addthis.com/dashboard to customize your tools -->
                    <div class="addthis_sharing_toolbox"></div>
                <% } %>
            </div>

            <!-- Comments -->
            <% if (item.comment != false) { %>
                <div class="col-lg-8 col-lg-offset-2 col-md-10 col-md-offset-1">
                    <%- partial("_partial/comments.ejs") %>
                </div>
            <% } %>
        </div>
    </div>
</article>