Skip to content

Commit

Permalink
feat(authors): add support for avatar
Browse files Browse the repository at this point in the history
fix #362
  • Loading branch information
talha131 committed Jul 5, 2019
1 parent 35a35b0 commit cc92230
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 8 deletions.
8 changes: 7 additions & 1 deletion static/css/elegant.css
Original file line number Diff line number Diff line change
Expand Up @@ -647,11 +647,17 @@ div.figure.align-left,
}
/* Author blurb */
.author_blurb {
font-variant: small-caps;
font-style: italic;
padding: 5px 0;
}
.author_blurb img {
padding: 0;
width: 32px;
height: 32px;
}
.author_name {
font-weight: bold;
font-variant: small-caps;
}
/* Github Gist */
.gist table {
Expand Down
29 changes: 22 additions & 7 deletions templates/_includes/article_author.html
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 %}

0 comments on commit cc92230

Please sign in to comment.