Feature: Adding linkback functionality Author avatar & Name (#1386)

* adding linkback funct to author avatar & nm

* rm author_class; change linkback var to home; updating config docs
This commit is contained in:
Andrew Newhouse 2017-12-11 12:37:10 -05:00 committed by Michael Rose
parent 5490b6f46a
commit 9ca57649c1
3 changed files with 26 additions and 3 deletions

View file

@ -9,15 +9,32 @@
{% if author.avatar %}
<div class="author__avatar">
{% if author.avatar contains "://" %}
<img src="{{ author.avatar }}" alt="{{ author.name }}" itemprop="image">
{% assign author_src = author.avatar %}
{% else %}
<img src="{{ author.avatar | absolute_url }}" class="author__avatar" alt="{{ author.name }}" itemprop="image">
{% assign author_src = author.avatar | absolute_url %}
{% endif %}
{% if author.home %}
{% if author.home contains "://" %}
{% assign author_link = author.home %}
{% else %}
{% assign author_link = author.home | absolute_url %}
{% endif %}
<a href="{{ author_link }}">
<img src="{{ author_src }}" alt="{{ author.name }}" itemprop="image">
</a>
{% else %}
<img src="{{ author_src }}" alt="{{ author.name }}" itemprop="image">
{% endif %}
</div>
{% endif %}
<div class="author__content">
{% if author.home %}
<a href="{{ author_link }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
{% else %}
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
{% endif %}
{% if author.bio %}
<p class="author__bio" itemprop="description">
{{ author.bio }}

View file

@ -128,6 +128,11 @@
padding-left: 0;
padding-right: 0;
}
a {
color: inherit;
text-decoration: none;
}
}
.author__name {

View file

@ -646,6 +646,7 @@ author:
bio : "My awesome biography constrained to a sentence or two goes here."
email : # optional
uri : "http://your-site.com"
home : # null (default), "absolute or relative url to link to author home"
```
Social media links are all optional, include the ones you want visible. In most cases you just need to add the username. If you're unsure double check `_includes/author-profile.html` to see how the URL is constructed.