Skip to content

Commit

Permalink
refacored code to align with vocab markup for person
Browse files Browse the repository at this point in the history
  • Loading branch information
Queen-codes committed Dec 24, 2024
1 parent a152f41 commit 6a3f967
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 25 deletions.
38 changes: 16 additions & 22 deletions themes/vocabulary_theme/templates/author.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,21 @@
{% block title %}{{ render_author_name(this) }}{% endblock %}

{% block body %}
<div class="author-posts">
<div class="header">
<div class="container">
<div class="columns">
<div class="column is-one-quarter-tablet-only is-2-desktop">
<figure class="image profile">
<img class="profile" src="https://secure.gravatar.com/avatar/{{ this.md5_hashed_email }}?size=200&d=mp" alt="gravatar">
</figure>
</div>
<div class="column content is-8">
<h2>{{ render_author_name(this) }}</h2>
{% if this.about %}
<div class="about">{{ this.about }}</div>
{% endif %}
<a class="button small" href="{{ this.parent|url }}">See all authors</a>
</div>
</div>
</div>
<header>
<h1>{{ render_author_name(this) }}</h1>
<figure>
<img class="profile" src="https://secure.gravatar.com/avatar/{{ this.md5_hashed_email }}?size=200&d=mp" alt="{{ render_author_name(this) }}'s gravatar">
</figure>
<div class="bio">
{% if this.about %}
<p>{{ this.about }}</p>
{% endif %}
<!--To-do: review legacy button design-->
<a href="{{ this.parent|url }}">See all authors</a>
</div>
<div class="posts container">
{{ render_author_posts(this.children) }}
</div>
</div>
</header>
<article class="posts">
<h2>Posts by {{ render_author_name(this) }}</h2>
{{ render_author_posts(this.children) }}
</article>
{% endblock %}
4 changes: 2 additions & 2 deletions themes/vocabulary_theme/templates/macros/author_posts.html
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
{% from "macros/posts.html" import render_post_summary %}

{% macro render_author_posts(posts) %}
<div class="columns is-multiline blog-entries">
<article class="post">
{% for post in posts %}
{{ render_post_summary(post, true) }}
{% endfor %}
</div>
</article>
{% endmacro %}
2 changes: 1 addition & 1 deletion themes/vocabulary_theme/templates/macros/posts.html
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ <h3 class="title"><a href="{{ post|url }}">{{ post.title }}</a></h3>
{% endmacro %}

{% macro render_posts(posts) %}
<div class="columns is-multiline blog-entries">
<article class="posts">
{% for post in posts %}
{% set post_loop = loop %}
{{ render_post_summary(post) }}
Expand Down

0 comments on commit 6a3f967

Please sign in to comment.