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

Conversation

shredtechular
Copy link
Contributor

This pull request is an attempt at addressing #1331. This is the simplest/cleanest way that I can think to add this functionality. If this is too messy, I completely understand and we can close this and I can simply do it locally, but again, I always like to keep customization as minimal as possible to more easily take advantage of future updates.

At any rate, I think this solution does solve the concern noted in #1331 around easily turning it on/off and allowing it for one, some, or many authors depending on the site's structure.

Basically, the code will check for an author.linkback yml key and if it is set, then it will add the link around a given author's avatar and name. If it is not set, then the link will not be generated.

If this is something you'd consider adding in, I can certainly update the docs where applicable, but wanted to see if you'd even consider this before doing that?

{% 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.

@mmistakes
Copy link
Owner

This looks pretty clean to me so I'm good with merging in with some minor adjustments.

Left a note above about the author__avatar class that was inconsistently applied to the bio image. I think I left that in by mistake, but it's not needed anymore.

The only thing giving me pause is the naming of linkback. Not sure if there is something better that is more clear or semantic. So if anyone has other suggestions I'm all ears. If nothing better comes in then link_back would follow the style of other site variables.

And yes, feel free to add this to the Configuration docs and a line in _config.yml similar to the others.

@shredtechular
Copy link
Contributor Author

Thanks for the feedback!

I didn't realize that about author__avatar so I removed that in my update 890cf66. I also updated the Configuration docs adding a line for the author site variable.

As far as the name of what variable to use there, I'm also open to suggestions on what might be the most clear. Instead of link_back I changed it to simply home with the reasoning that folks that use this feature would probably be wanting to link to either the site's "home" page or an author "home" or "index" page. Do you like that better or does that still not describe it adequately?

@mmistakes
Copy link
Owner

home sounds good to me. Thanks for making the change.

@mmistakes mmistakes merged commit 9ca5764 into mmistakes:master Dec 11, 2017
kdow pushed a commit to kdow/minimal-mistakes that referenced this pull request Dec 31, 2017
…s#1386)

* adding linkback funct to author avatar & nm

* rm author_class; change linkback var to home; updating config docs
kkunapuli pushed a commit to kkunapuli/kkunapuli.github.io that referenced this pull request May 30, 2019
…s#1386)

* adding linkback funct to author avatar & nm

* rm author_class; change linkback var to home; updating config docs
sumeetmondal pushed a commit to sumeetmondal/sumeetmondal.github.io that referenced this pull request Sep 10, 2019
…s#1386)

* adding linkback funct to author avatar & nm

* rm author_class; change linkback var to home; updating config docs
jchwenger pushed a commit to jchwenger/jchwenger.github.io that referenced this pull request May 5, 2023
…s#1386)

* adding linkback funct to author avatar & nm

* rm author_class; change linkback var to home; updating config docs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants