add support for authors an an array
This commit is contained in:
parent
902126fd4b
commit
f1cdf62b53
|
@ -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 %}
|
||||
|
|
|
@ -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{<meta name="twitter:creator" content="@test" />}
|
||||
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) }
|
||||
|
|
Loading…
Reference in New Issue