-
Notifications
You must be signed in to change notification settings - Fork 293
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
Conversation
Sorry for all the pr open/close. |
Have seen this done with a |
example usage: |
I have no idea why this build is failing....can someone help? |
Failing test looks unrelated. |
Weird for it to suddenly start failing though, master looks to be passing. |
This is the test that is failing. I don't know how it could be related to the changes in this PR. /cc: @benbalter |
The failing test looks like a change in either Addressable or Jekyll's invalid URL handling behavior and can likely be removed, either here, or via a separate PR and then merge in master. |
Changing liquid and documentation I can do. |
For what it's worth, that was exactly where I was when I started hacking on Jekyll. That said, if I have time tonight I will look into modifying/dropping the failing test 👍 |
Fixed via #228 |
lib/template.html
Outdated
<meta name="twitter:card" content="summary" /> | ||
{% else %} | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Per the discussion over in #222 (comment), would it make more sense to implement this as something like:
<meta name="twitter:card" content="{{ page.twitter.card | default: site.twitter.card | default: "summary_large_image" }}" />
That way if Twitter adds a "medium" card next year, we're still covered.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I did try this and whilst I agree it does add future scope, the usage in the consuming site doesn't look/feel as nice as a true/false.
If adding as discussed with defaults is the only way to get this in, then I guess I concede, but imo, code should be implemented for the current scope, not all possible future scope 🙂
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not strongly opinionated. If others feel strongly one way or the other, glad to support the consensus.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My other theory is, with this, users don't need to know the names Twitter use, they can see in the docs here there is a true/false to make it small.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There are already other types of cards (app
and player
for now): https://dev.twitter.com/cards/types. We might as well support those.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
App and player cards require other meta data info rather than just the image, do there is quite a bit more effort required.
For a simple image based card which is what this section has, there is just small or big image.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Having been 6 months on this...is the only way to get this in to force the user to put the exact card type into their front matter?
To repeat why I went with this approach, Twitter has 2 card types that would work with the rest of the meta this plugin adds.
By using a Boolean option, the user doesn't need to know the exact twitter card names (which is one plus for this whole plugin, the user doesn't need to know all the meta tags)
I would appreciate a definite change to get in, or a merge as is so this can move forward please.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boolean seems clunky. Ie: Why twitter_image_small: true
instead of twitter_image_large: false
?
Let's go with twitter.card: summary_large_image
👍
lib/template.html
Outdated
<meta name="twitter:card" content="summary" /> | ||
{% else %} | ||
<meta name="twitter:card" content="summary_large_image" /> | ||
{% endif %} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The boolean seems clunky. Ie: Why twitter_image_small: true
instead of twitter_image_large: false
?
Let's go with twitter.card: summary_large_image
👍
@BlythMeister Sorry this has sat for so long. Ping me when you've made the changes and I will review. |
@pathawks updates made as requested. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We might want to change the behavior down the line if Twitter offers additional card types, but 👍 for now.
docs/usage.md
Outdated
|
||
```yml | ||
twitter: | ||
username: benbalter | ||
card: summary_large_image |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the other card types available? We could use a value different from the default's one here.
This is so it doesn't use the default value
@DirtyF updated to "summary" which is the smaller card |
Remove Facebook app ID Applied workaround for twitter:card value (see. jekyll/jekyll-seo-tag#225)
@DirtyF @benbalter @pathawks can this be put in now? |
Awesome. Thanks for all your work on this! 👍🍻 @jekyllbot: +minor |
Update to #222 with cleaner history.
Original details:
Add ability at site level to not use the large twitter summary
Current rather yucky workaround is doing this:
fix #84