Skip to content

Commit ae65f85

Browse files
shredtechularmmistakes
authored andcommitted
Feature: Adding linkback functionality Author avatar & Name (mmistakes#1386)
* adding linkback funct to author avatar & nm * rm author_class; change linkback var to home; updating config docs
1 parent 4430789 commit ae65f85

File tree

3 files changed

+26
-3
lines changed

3 files changed

+26
-3
lines changed

_includes/author-profile.html

+20-3
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,32 @@
99
{% if author.avatar %}
1010
<div class="author__avatar">
1111
{% if author.avatar contains "://" %}
12-
<img src="{{ author.avatar }}" alt="{{ author.name }}" itemprop="image">
12+
{% assign author_src = author.avatar %}
1313
{% else %}
14-
<img src="{{ author.avatar | absolute_url }}" class="author__avatar" alt="{{ author.name }}" itemprop="image">
14+
{% assign author_src = author.avatar | absolute_url %}
15+
{% endif %}
16+
17+
{% if author.home %}
18+
{% if author.home contains "://" %}
19+
{% assign author_link = author.home %}
20+
{% else %}
21+
{% assign author_link = author.home | absolute_url %}
22+
{% endif %}
23+
<a href="{{ author_link }}">
24+
<img src="{{ author_src }}" alt="{{ author.name }}" itemprop="image">
25+
</a>
26+
{% else %}
27+
<img src="{{ author_src }}" alt="{{ author.name }}" itemprop="image">
1528
{% endif %}
1629
</div>
1730
{% endif %}
1831

1932
<div class="author__content">
20-
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
33+
{% if author.home %}
34+
<a href="{{ author_link }}"><h3 class="author__name" itemprop="name">{{ author.name }}</h3></a>
35+
{% else %}
36+
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
37+
{% endif %}
2138
{% if author.bio %}
2239
<p class="author__bio" itemprop="description">
2340
{{ author.bio }}

_sass/minimal-mistakes/_sidebar.scss

+5
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,11 @@
128128
padding-left: 0;
129129
padding-right: 0;
130130
}
131+
132+
a {
133+
color: inherit;
134+
text-decoration: none;
135+
}
131136
}
132137

133138
.author__name {

docs/_docs/05-configuration.md

+1
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,7 @@ author:
646646
bio : "My awesome biography constrained to a sentence or two goes here."
647647
email : # optional
648648
uri : "http://your-site.com"
649+
home : # null (default), "absolute or relative url to link to author home"
649650
```
650651

651652
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.

0 commit comments

Comments
 (0)