<div class=post>
    <div class="info {% if post.recovered %}recovered{% endif %}">
        <div class = title>
            <a href="{{ post.filename }}">
                <h1>{{ post.title }}</h1>
            </a>
        </div>

        <div class="links">
            {% if post.paths %}<a href="{{ post.paths[0] }}">Local Link</a> | {% endif %}<a href="{{ post.url }}">Content link</a> | <a href="https://www.reddit.com{{ post.permalink }}">Reddit Link</a>
        </div>
        <div class="post_info">
        <time>{{ post.created_utc | float_to_datetime }}</time><a href='https://reddit.com/r/{{ post.subreddit }}'><span class="subreddit">r/{{ post.subreddit }}</span></a><a href='https://reddit.com/u/{{ post.author }}'><span class="user">u/{{ post.author }}</span></a>
        <span title="{{ post.upvote_ratio }}" class="score">({{ post.score }})</span> {% if post.over_18 %}<span class=mature> 18+ </span> {% endif %}
    </div></div>

        {%- if post.selftext %}
            <div class=content>{{ post.selftext | markdown}}</div>
        {%- endif %}
        {% if post.paths | length == 1 %}
            {% if '.gif' in post.paths[0] or '.jpg' in post.paths[0] or '.jpeg' in post.paths[0] or'.png' in post.paths[0] %}
                <a href="{{ post.paths[0] }}"><img src="{{ post.paths[0] }}" loading="lazy"></a>
            {% endif %}
            {% if '.mp4' in post.paths[0] or '.m4a' in post.paths[0] %}
                <video controls {% if post.thumbnail %} poster='./thumbnails/{{ post.thumbnail }}'{% endif %} preload="metadata"><source src="{{ post.paths[0] }}"></video>
            {% endif %}
        {% endif %}
        {% if post.paths | length > 1 %}
            <div class=content>{% include 'gallery.html' %}</div>
        {% endif %}

</div>
