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 #222

Closed
wants to merge 5 commits into from
Closed

Configure default Twitter summary card type #222

wants to merge 5 commits into from

Conversation

BlythMeister
Copy link
Contributor

@BlythMeister BlythMeister commented Jul 26, 2017

Add ability at site level to not use the large twitter summary

Current rather yucky workaround is doing this:

{% capture seo %}
{% seo %}
{% endcapture %}

{{ seo | replace: "summary_large_image", "summary" }}

fix #84

Add ability at site level to not use the large twitter summary
@carlows
Copy link

carlows commented Aug 3, 2017

Would be great to have this!

Copy link
Member

@mattr- mattr- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mattr-
Copy link
Member

mattr- commented Aug 4, 2017

Any other objections @pathawks @DirtyF or @benbalter ?

Copy link
Member

@DirtyF DirtyF left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No objection, except about the naming, don't forget to add documentation if this is accepted.

@@ -51,7 +51,11 @@

{% if site.twitter %}
{% if seo_tag.image %}
<meta name="twitter:card" content="summary_large_image" />
{% if site.twitter.smallSummary %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What about just naming this twitter.summary?

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alternatively, perhaps something like <meta name="twitter:card" content="{{ site.twitter.card | default: "summary_large_image" }}" /> may be more intuitive to end users?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like that idea!
Is there a way to do a double default.
E.g.
Page.twitter.card
Then
Site.twitter.card
Then
Summary large image

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep! You can chain defaults, e.g., | default: page.twitter.card | default: site.twitter.card...

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet, leave this with me...I like that 👍

@DirtyF DirtyF requested review from pathawks and benbalter August 4, 2017 09:13
@DirtyF DirtyF changed the title Fix for #84 Configure default Twitter summary card type Aug 4, 2017
@BlythMeister
Copy link
Contributor Author

Updates made, also given option for a site level image.
On my site i had to add the same image to every post/page
Post/Page takes priority as does the card size

@BlythMeister
Copy link
Contributor Author

Disclaimer: I'm not sure how to test these changes locally, so it is in untested.

I did also update the docs as part of this pr

@BlythMeister
Copy link
Contributor Author

I have just realised this is now over complex and could be done using defaults.
Please disregard these changes I will raise a clean fresh or and link to this one.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Should be able to add image to Twitter card without it being a large image
6 participants