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) }