<div class="card card-post-preview mb-4">
  <div class="card-body">
    <div class="row no-gutters">
      <div class="col-3 d-none d-md-flex my-auto card-post-img">
        {% if post.image %}
          <img class="rounded-circle img-fluid d-flex mx-auto" src="{{ post.image }}">
        {% else %}
          <img class="rounded-circle img-fluid d-flex mx-auto" src="/assets/mahout-logo-blue.svg">
        {% endif %}
      </div>
      <div class="col-12 col-md-9 card-post-text">
        <div class="clearfix mb-3">
          <ul class="list-inline float-md-left mb-md-0">
            {% if post %}
              {% assign categories = post.categories %}
            {% else %}
              {% assign categories = page.categories %}
            {% endif %}
            {% for category in categories %}
              <li class="list-inline-item">
                <a class="small text-uppercase" href="#">{{category}}</a>
              </li>
              {% unless forloop.last %}&nbsp;{% endunless %}
            {% endfor %}
          </ul>
          <div class="float-md-right small text-muted">{{ post.date | date: '%B %d, %Y' }}</div>
        </div>
        <h3 class="card-title"><a href="{{ post.url }}">{{ post.title }}</a></h3>
        <p>{{ post.excerpt | strip_html | truncatewords: 30 }}</p>
        <a href="{{ post.url }}" class="btn btn-primary btn-sm">Read Post &rarr;</a>
      </div>
    </div>
  </div>
</div>
