Resolve #422 Support for Twitter DNT

This commit is contained in:
Ain Tohvri 2021-04-16 23:25:52 +02:00
parent 93c664bce0
commit 8ea8bdfab2
No known key found for this signature in database
GPG Key ID: 3611BB7A7B3376AC
2 changed files with 15 additions and 0 deletions

View File

@ -109,6 +109,10 @@
<meta name="google-site-verification" content="{{ site.google_site_verification }}" />
{% endif %}
{% if site.do_not_track.twitter %}
<meta name="twitter:dnt" content="on">
{% endif %}
<script type="application/ld+json">
{{ seo_tag.json_ld | jsonify }}
</script>

View File

@ -686,4 +686,15 @@ RSpec.describe Jekyll::SeoTag do
end
end
end
context "with do_not_track" do
context "with twitter" do
let(:site) { make_site("do_not_track" => { "twitter" => true }) }
it "adds DNT metadata for Twitter embeds" do
expected = %r!<meta name="twitter:dnt" content="on">!
expect(output).to match(expected)
end
end
end
end