Added the `twitter:description` tag (#464)

Merge pull request 464
This commit is contained in:
Amir Masoud Abdol 2022-07-14 01:47:29 +02:00 committed by GitHub
parent 62d7e8af8b
commit 799da8f3bf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 0 deletions

View File

@ -18,6 +18,7 @@
{% if seo_tag.description %} {% if seo_tag.description %}
<meta name="description" content="{{ seo_tag.description }}" /> <meta name="description" content="{{ seo_tag.description }}" />
<meta property="og:description" content="{{ seo_tag.description }}" /> <meta property="og:description" content="{{ seo_tag.description }}" />
<meta property="twitter:description" content="{{ seo_tag.description }}" />
{% endif %} {% endif %}
{% if site.url %} {% if site.url %}

View File

@ -124,6 +124,7 @@ RSpec.describe Jekyll::SeoTag do
it "uses the page description" do it "uses the page description" do
expect(output).to match(%r!<meta name="description" content="foo" />!) expect(output).to match(%r!<meta name="description" content="foo" />!)
expect(output).to match(%r!<meta property="og:description" content="foo" />!) expect(output).to match(%r!<meta property="og:description" content="foo" />!)
expect(output).to match(%r!<meta property="twitter:description" content="foo" />!)
end end
end end
@ -133,6 +134,7 @@ RSpec.describe Jekyll::SeoTag do
it "uses the page excerpt when no page description exists" do it "uses the page excerpt when no page description exists" do
expect(output).to match(%r!<meta name="description" content="foo" />!) expect(output).to match(%r!<meta name="description" content="foo" />!)
expect(output).to match(%r!<meta property="og:description" content="foo" />!) expect(output).to match(%r!<meta property="og:description" content="foo" />!)
expect(output).to match(%r!<meta property="twitter:description" content="foo" />!)
end end
end end
@ -142,6 +144,7 @@ RSpec.describe Jekyll::SeoTag do
it "uses the site description when no page description nor excerpt exist" do it "uses the site description when no page description nor excerpt exist" do
expect(output).to match(%r!<meta name="description" content="foo" />!) expect(output).to match(%r!<meta name="description" content="foo" />!)
expect(output).to match(%r!<meta property="og:description" content="foo" />!) expect(output).to match(%r!<meta property="og:description" content="foo" />!)
expect(output).to match(%r!<meta property="twitter:description" content="foo" />!)
end end
end end