From f1cdf62b530806b5eadabca840f0fdfd80c1c065 Mon Sep 17 00:00:00 2001 From: Ben Balter Date: Sun, 21 Feb 2016 13:52:49 -0500 Subject: [PATCH] add support for authors an an array --- lib/template.html | 2 +- spec/jekyll_seo_tag_spec.rb | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/lib/template.html b/lib/template.html index 62ab874..ee82f4c 100644 --- a/lib/template.html +++ b/lib/template.html @@ -39,7 +39,7 @@ {% assign seo_description = seo_description | markdownify | strip_html | strip_newlines | escape_once %} {% endif %} -{% assign seo_author = page.author | default: site.author %} +{% assign seo_author = page.author | default: page.authors[0] | default: site.author %} {% if seo_author %} {% if seo_author.twitter %} {% assign seo_author_twitter = seo_author.twitter %} diff --git a/spec/jekyll_seo_tag_spec.rb b/spec/jekyll_seo_tag_spec.rb index 8af81aa..2605bc7 100644 --- a/spec/jekyll_seo_tag_spec.rb +++ b/spec/jekyll_seo_tag_spec.rb @@ -227,6 +227,15 @@ describe Jekyll::SeoTag do end end + context 'with page.authors as an array' do + let(:page) { make_page('authors' => %w(test foo)) } + + it 'supports author data as an array' do + expected = %r{} + expect(output).to match(expected) + end + end + context 'with site.author as a hash' do let(:author) { { 'twitter' => '@test' } } let(:site) { make_site('author' => author, 'twitter' => site_twitter) }