{% macro mini_logo(classes, title, siteurl, logourl) %}
<img class="mini-logo {{ classes }}" src="{{siteurl}}/img/{{logourl}}"></img>
<span class="mini-logo-title">
    <a href="{{siteurl}}">{{title}}</a>
</span>
{% endmacro mini_logo %}

<!-- classes=any extra styling, bsize=buttonsize, extra=config.extra, siteurl=config.base_url -->
{% macro social_list(classes, bsize, extra, rss, siteurl) %}
<ul class="social-list {{classes}}" >
    {% if extra.website %}
    <li class="button {{bsize}} font_faint"><a href="https://{{extra.website}}" target="_blank">{{extra.website}}</a></li>
    {% endif %}

    {% if extra.book %}
    <li class="button {{bsize}} font_faint">
        <a title="Read The Book" href="https://{{extra.book}}" target="_blank">
            <i class="fa-solid fa-book"></i>
            book
        </a>
    </li>
    {% endif %}

    {% if extra.github %}
    <li class="button {{bsize}} font_faint">
        <a title="Visit GitHub Project" href="https://github.com/{{extra.github}}" target="_blank">
            <i class="fab fa-github"></i>
            {{extra.github}}
        </a>
    </li>
    {% endif %}

    {% if extra.discord %}
    <li class="button {{bsize}} font_faint">
        <a title="Join Community Discord" href="{{extra.discord}}" target="_blank">
            <i class="fab fa-discord"></i>
            discord
        </a>
    </li>
    {% endif %}

    <li class="button {{bsize}} font_faint">
        <a title="rust api docs" href="{{config.base_url}}/api/rune/">
            <i class="fab fa-rust"></i>
            rust docs (git)
        </a>
    </li>

    <li class="button {{bsize}} font_faint">
        <a title="rune docs" href="{{config.base_url}}/docs/">
            <i class="fa fa-book"></i>
            rune docs (git)
        </a>
    </li>

    {% if rss %}
    <li class="button {{bsize}} font_faint">
        <a href="{{siteurl}}/rss.xml" target ="_blank">
            <i class="fas fa-rss"></i>
            rss
        </a>
    </li>
    {% endif %}
</ul>
{% endmacro social_list %}

{% macro frontmatter(classes, author, date, word_count, read_time) %}
<ul class="frontmatter {{classes}}" id="frontmatter">
    {% if author %}
    <li>{{author}}</li>
    <span class="dot-divider"></span>
    {% endif %}
    <li>
        <time class="article_time"  datetime="{{date}}">{{ date | date(format="%B %d, %Y") }}</time>
    </li>
    <span class="dot-divider"></span>
    <li> {{word_count}} words </li>
    <span class="dot-divider" ></span>
    <li> {{read_time}} min </li>
</ul>
{% endmacro frontmatter %}

{%macro nav() %}
<nav>
    <a href="{{config.base_url}}">Home</a>
    <span class="dot-divider"></span>
    <a href="{{config.base_url}}/posts/">Posts</a>
    <span class="dot-divider"></span>
    <a href="{{config.base_url}}/play/">Playground</a>
</nav>
{% endmacro nav %}
