Skip to content
Snippets Groups Projects
author_media.html 942 B
Newer Older
{% set authors_data = load_data(path="authors.json") -%}
{% for author in post.authors -%}
<div class="media">
  <div class="media-left">
    <figure class="image is-48x48">
      {% 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>
  </div>
  <div class="media-content">
    <p class="title is-4">
      {{ authors_data[author].display_name }}
    </p>
  </div>
</div>
{% endfor %}