Skip to content
Snippets Groups Projects
post_card_image.html 990 B
{%- comment -%}

    This is a card displaying post metadata as well as the title image.
    Parameters:
        post: The post which sould be displayed on the card

{%- endcomment -%}
{%- if post.title_image == "default" %}
{%- assign image = 'hifis_page_title_background.jpg'-%}
{%- else -%}
{%- assign image = post.title_image -%}
{%- endif -%}
{%- assign img_url = site.directory.large_images
    | append: "phone/"
    | append: image
    | strip 
    | relative_url -%}
<div class="card">
    <a href="{{ include.post.url | relative_url }}">
        <img class="card-img-top card-img-equal" src="{{ img_url }}" alt="Title image">
        <div class="card-body">
            <span class="badge badge-pill badge-secondary">
                <i class="fas fa-calendar-day" aria-hidden="true"></i>
                {{ include.post.data | date: "%d.&thinsp;%b.&thinsp;%y" }}
            </span>
            <h3 class="card-title">{{ include.post.title }}</h3>
        </div>
    </a>
</div>