Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configure default Twitter summary card type (V2) #224

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,3 +65,6 @@ The SEO tag will respect the following YAML front matter if included in a post,
* `image` - URL to an image associated with the post, page, or document (e.g., `/assets/page-pic.jpg`)
* `author` - Page-, post-, or document-specific author information (see below)
* `lang` - Page-, post-, or document-specific language information
* `twitterCardType` - The type of twitter card to use

*Note:* Front matter defaults can be used for any of the above values as described [here] with an image example (https://github.com/BlythMeister/jekyll-seo-tag/blob/TwitterCard/docs/advanced-usage.md#setting-a-default-image)
2 changes: 1 addition & 1 deletion lib/jekyll-seo-tag/drop.rb
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def title
end
end
end

def name
return @name if defined?(@name)
@name = if seo_name
Expand Down
2 changes: 1 addition & 1 deletion lib/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@

{% if site.twitter %}
{% if seo_tag.image %}
<meta name="twitter:card" content="summary_large_image" />
<meta name="twitter:card" content="{{ page.twitterCardType | default: "summary_large_image" }}" />
{% else %}
<meta name="twitter:card" content="summary" />
{% endif %}
Expand Down