Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature: Adding linkback functionality Author avatar & Name #1386

Merged
merged 2 commits into from
Dec 11, 2017
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 22 additions & 3 deletions _includes/author-profile.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,34 @@
{% 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 %}
{% assign author_class = "" %}
{% else %}
<img src="{{ author.avatar | absolute_url }}" class="author__avatar" alt="{{ author.name }}" itemprop="image">
{% assign author_src = author.avatar | absolute_url %}
{% assign author_class = "author__avatar" %}
Copy link
Owner

@mmistakes mmistakes Dec 7, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you can safely remove the author_class stuff. Looking back at my original code class="author__avatar" on the <img> element was left in mistakenly. It's applied on the wrapper div and not needed anymore.

{% endif %}

{% if author.linkback %}
{% if author.linkback contains "://" %}
{% assign author_link = author.linkback %}
{% else %}
{% assign author_link = author.linkback | absolute_url %}
{% endif %}
<a href="{{ author_link }}">
<img src="{{ author_src }}" class="{{ author_class }}" alt="{{ author.name }}" itemprop="image">
</a>
{% else %}
<img src="{{ author_src }}" class="{{ author_class }}" alt="{{ author.name }}" itemprop="image">
{% endif %}
</div>
{% endif %}

<div class="author__content">
<h3 class="author__name" itemprop="name">{{ author.name }}</h3>
{% if author.linkback %}
<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 }}
Expand Down
5 changes: 5 additions & 0 deletions _sass/minimal-mistakes/_sidebar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,11 @@
padding-left: 0;
padding-right: 0;
}

a {
color: inherit;
text-decoration: none;
}
}

.author__name {
Expand Down