-
Notifications
You must be signed in to change notification settings - Fork 188
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(authors): add support for avatar
fix #362
- Loading branch information
Showing
2 changed files
with
29 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,26 @@ | ||
{% macro article_author(article) %} | ||
<div> | ||
{% set tag = namespace({'open' : true, 'close': false}) %} | ||
{% for author in article.authors %} | ||
{% if author|string in AUTHORS %} | ||
{% if tag.open %} | ||
<section> | ||
<hr /> | ||
{% for author in article.authors %} | ||
{% if author|string in AUTHORS %} | ||
<span class="author_blurb"><a href="{{ AUTHORS.get(author|string).url }}"><span class="author_name">{{ author }}</span></a> - | ||
{{ AUTHORS.get(author|string).blurb }}</span><br /> | ||
{% endif %} | ||
{% set tag.open = false %} | ||
{% set tag.close = true %} | ||
{% endif %} | ||
{% set auth = AUTHORS.get(author|string) %} | ||
<div class="author_blurb"> | ||
<a href="{{ auth.url }}"> | ||
{% if AUTHORS.get(author|string).avatar %} | ||
<img src={{auth.avatar}} alt="{{author}} Avatar" title={{author}}> | ||
{% endif %} | ||
<span class="author_name">{{ author }}</span> | ||
</a> | ||
{{ auth.blurb }} | ||
</div> | ||
{% endif %} | ||
{% endfor %} | ||
</div> | ||
{% if tag.close %} | ||
</section> | ||
{% endif %} | ||
{% endmacro %} |