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) #225

Merged
merged 11 commits into from
May 3, 2018
10 changes: 8 additions & 2 deletions docs/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,16 @@ The SEO tag will respect any of the following if included in your site's `_confi
* `description` - A short description (e.g., A blog dedicated to reviewing cat gifs)
* `url` - The full URL to your site. Note: `site.github.url` will be used by default.
* `author` - global author information (see [Advanced usage](advanced-usage.md#author-information))
* `twitter:username` - The site's Twitter handle. You'll want to describe it like so:

* `twitter` - The following properties are available:
* `twitter:card` - The site's default card type
* `twitter:username` - The site's Twitter handle. You'll want to describe it like so:

```yml
twitter:
username: benbalter
```
   card: summary
 ```

* `facebook` - The following properties are available:
* `facebook:app_id` - a Facebook app ID for Facebook insights
Expand Down Expand Up @@ -66,3 +70,5 @@ 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 [Advanced usage](advanced-usage.md#author-information))
* `lang` - Page-, post-, or document-specific language information

*Note:* Front matter defaults can be used for any of the above values as described in advanced usage with an image example.
2 changes: 1 addition & 1 deletion lib/template.html
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@

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