diff --git a/templates/blog/author_media.html b/templates/blog/author_media.html new file mode 100644 index 0000000000000000000000000000000000000000..6bda26bd716c7239207596023a3b716bb78d1305 --- /dev/null +++ b/templates/blog/author_media.html @@ -0,0 +1,24 @@ +{% 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 %} diff --git a/templates/blog/card.html b/templates/blog/card.html index a23afb798621b6f19171c5441c658ad698578173..d401ac460c7c353c78d9334569f77015a9ca2d72 100644 --- a/templates/blog/card.html +++ b/templates/blog/card.html @@ -13,11 +13,14 @@ <div class="card-content"> <a href="{{ post.permalink }}"><h3 class="title is-4">{{ post.title }}</h3></a> <div class="content"> + {% include "blog/meta_line.html" -%} {{ post.summary | safe }} </div> <div class="card-footer"> <div class="card-footer-item"> - {% include "blog/meta_media.html" -%} + <div class=""> + {% include "blog/author_media.html" -%} + </div> </div> </div> </div> diff --git a/templates/blog/meta_line.html b/templates/blog/meta_line.html new file mode 100644 index 0000000000000000000000000000000000000000..cb101e887939f79c9678b4bf1a19aac34c171a9b --- /dev/null +++ b/templates/blog/meta_line.html @@ -0,0 +1,5 @@ +<p class="subtitle is-7"> + <span title="Veröffentlicht am"><i class="fa-solid fa-calendar-days"></i> {{ post.date }}</span> · + <span title="Lesezeit"><i class="fa-solid fa-hourglass-start"></i> {{ post.reading_time }} min</span> +</p> + diff --git a/templates/blog/meta_media.html b/templates/blog/meta_media.html deleted file mode 100644 index fff605e7dfd258141e69e2be653ea67be8351751..0000000000000000000000000000000000000000 --- a/templates/blog/meta_media.html +++ /dev/null @@ -1,17 +0,0 @@ -{% set authors_data = load_data(path="authors.json") -%} -<div class="media"> - <div class="media-left"> - <figure class="image is-48x48"> - {% set image = resize_image(path="authors/" ~ post.authors.0 ~ ".jpg", width=48, height=48) -%} - <img class="is-rounded" src="{{ image.url }}" alt="Benutzerbild von {{ authors_data[post.authors.0].display_name }}" /> - </figure> - </div> - <div class="media-content"> - <p class="title is-4">{{ authors_data[post.authors.0].display_name }}</p> - <p class="subtitle is-7"> - @{{ post.authors.0 }} · - <span title="Veröffentlicht am"><i class="fa-solid fa-calendar-days"></i> {{ post.date }}</span> · - <span title="Lesezeit"><i class="fa-solid fa-hourglass-start"></i> {{ post.reading_time }} min</span> - </p> - </div> -</div> diff --git a/templates/blog/post.html b/templates/blog/post.html index 243e6b9259cc5c1f40b3702ded881cbbf703ffd7..b7212f9d67ddb2201b18a2014b148ae40257538d 100644 --- a/templates/blog/post.html +++ b/templates/blog/post.html @@ -20,7 +20,12 @@ </figure> </div> <div class="card-content"> - {% include "blog/meta_media.html" %} + {% include "blog/author_media.html" %} + </div> + <div class="card-footer"> + <div class="card-footer-item"> + {% include "blog/meta_line.html" -%} + </div> </div> </div> </div>