jekyll / jekyll-avatar

A Jekyll plugin for rendering GitHub avatars
MIT License
89 stars 9 forks source link

Issue with custom variable for `user` #7

Closed XhmikosR closed 6 years ago

XhmikosR commented 8 years ago

So, I was trying to get this working, but I end up with the same image from the first loop item.

Code fragment

 <div class="row">
     <div class="col-md-12">
         <div class="list-group mpc-team">
           {% for member in site.data.team.active %}
             <div class="list-group-item">
               <iframe class="github-btn" src="https://ghbtns.com/github-btn.html?user={{ member.user }}&amp;type=follow" title="Follow {{ member.user }} on GitHub"></iframe>
               <a class="team-member" href="https://github.com/{{ member.user }}">
                  {% avatar {{ member.user }} size=32 %}
                  <strong>{{ member.name }}</strong> <small>@{{ member.user }}</small>
               </a>
             </div>
           {% endfor %}
         </div>
     </div>
 </div>

Output: screen shot 2016-02-27 at 13 12 03

Full code https://github.com/mpc-hc/mpc-hc.org/tree/about

Am I missing something?

XhmikosR commented 8 years ago

I tried the same for Bootstrap (https://github.com/twbs/bootstrap/compare/v4-dev...v4-dev-docs), and I get the same results. Something seems weird @benbalter :/

pathawks commented 8 years ago

Can you try it without the extra braces?

{% avatar member.user size=32 %}
benbalter commented 8 years ago

Also try {% avatar user=member.user size=32 %}

XhmikosR commented 8 years ago

Thanks both of you for the replies. I'll try it when I'm at home. BTW this was taken from the Readme example. On Feb 27, 2016 20:20, "Ben Balter" notifications@github.com wrote:

Also try {% avatar user=member.user size=32 %}

— Reply to this email directly or view it on GitHub https://github.com/benbalter/jekyll-avatar/issues/7#issuecomment-189698710 .

XhmikosR commented 8 years ago

I tried both solutions, none of them works.

benbalter commented 8 years ago

One last try:

{% assign user = member.user %}
{% avatar {{ user }} %}

or

{% assign user = member.user %}
{% avatar user=user %}

It's a quirk with our Liquid passes context to plugins.

XhmikosR commented 8 years ago

The last one works!

stale[bot] commented 6 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.