diff --git a/_source/_plugins/excerpt.rb b/_source/_plugins/excerpt.rb index 4a96af97c..0f3e38470 100644 --- a/_source/_plugins/excerpt.rb +++ b/_source/_plugins/excerpt.rb @@ -12,11 +12,25 @@ def render(context) if !post.nil? title = post['title'] - # one day figure out how to add author - # author_id = post['author'] - # author = context.registers[:site].data['authors'][author_id] - # avatar = author['avatar'] - # display_name = author['full_name'] + author_content = "" + + if !post['author'].kind_of?(Array) + author_id = post['author'] + + author = context.registers[:site].data['authors'][author_id] + avatar = author['avatar'] + display_name = author['full_name'] + img=Liquid::Template.parse("{% img '#{avatar}' alt:'avatar-#{avatar}' class:BlogPost-avatar %}").render(context) + author_content = %(
+ + #{img} + + + #{display_name} + +
) + end + description = post['description'] if (description.nil?) @@ -29,6 +43,7 @@ def render(context) #{title}

#{description}

+
#{author_content}
) else %(