Skip to content
Snippets Groups Projects
author_media.html 1.03 KiB
<div class="columns">
  <div class="column">
{% set authors_data = load_data(path="authors.json") -%}
{% for author in post.authors -%}
    <figure class="image is-48x48 is-inline-block" style="margin-right:  -30px;">
      {% set meta = get_image_metadata(path="authors/" ~ author ~ ".jpg", allow_missing=true) -%}
      {% if meta -%}
        {% set image = resize_image(path="authors/" ~ author ~ ".jpg", width=48, height=48) -%}
        <img class="is-rounded" src="{{ image.url }}" alt="Benutzerbild von {{ authors_data[post.authors.0].display_name }}" />
      {% else -%}
        <span class="fa-stack fa-lg">
          <i class="fa-solid fa-circle fa-stack-2x"></i>
          <i class="fa-solid fa-{{ author | truncate(length=1, end="") | lower() }} fa-stack-1x fa-inverse"></i>
        </span>
      {% endif -%}
    </figure>
{% endfor %}
  </div>
  <ul class="column is-three-fifths">
{% for author in post.authors -%}
    <li class="title is-5 is-inline mr-3">
      {{ authors_data[author].display_name }}
    </li>
{% endfor %}
  </ul>
</div>