summaryrefslogtreecommitdiff
path: root/themes/after-dark/templates/post_macros.html
blob: 2a9566b483022daaa0f7f05512f61da7c3a2a991 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
{% macro meta(page) %}
    <svg style="margin-bottom:-3px" class="i-clock" viewBox="0 0 32 32"
         width="16" height="16" fill="none" stroke="currentcolor"
         stroke-linecap="round" stroke-linejoin="round" stroke-width="6.25%">
        <circle cx="16" cy="16" r="14"/>
        <path d="M16 8 L16 16 20 20"/>
    </svg>
    <span>{{ page.reading_time }} minute read</span>
    <svg style="margin-bottom: -3px" class="i-edit" viewBox="0 0 32 32"
         width="16" height="16" fill="none" stroke="currentcolor"
         stroke-linecap="round" stroke-linejoin="round" stroke-width="6.25%">
        <path d="M30 7 L25 2 5 22 3 29 10 27 Z M21 6 L26 11 Z M5 22 L10 27 Z"/>
    </svg>

    {% if page.date %}Published: {{ page.date | date(format="%F") }}{% endif %}
{% endmacro meta %}

{% macro page_in_list(page) %}
    <article itemscope itemtype="http://schema.org/CreativeWork">
        <header>
            <h2 itemprop="name">
                <a href="{{ page.permalink | safe }}">{{ page.title }}</a>
            </h2>
            <span class="muted">{{ self::meta(page=page) }}</span>
        </header>
        {% if page.summary %}
            <div itemprop="summary">
                {{ page.summary | safe }}
                <nav class="readmore"><a itemprop="url" href="{{ page.permalink | safe }}">Read More&nbsp;&raquo;</a></nav>
            </div>
        {% endif %}
    </article>
{% endmacro page_in_list %}