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
Merged

Configure default Twitter summary card type (V2) #225

merged 11 commits into from
May 3, 2018

Conversation

BlythMeister
Copy link
Contributor

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:

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

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

fix #84

@BlythMeister
Copy link
Contributor Author

Sorry for all the pr open/close.
Had a right nightmare

@BlythMeister
Copy link
Contributor Author

Have seen this done with a twitter_image_small flag set to true or false.
What's you opinion on that instead?

@BlythMeister
Copy link
Contributor Author

@BlythMeister
Copy link
Contributor Author

I have no idea why this build is failing....can someone help?

@pathawks
Copy link
Member

pathawks commented Aug 8, 2017

Failing test looks unrelated.

@BlythMeister
Copy link
Contributor Author

Weird for it to suddenly start failing though, master looks to be passing.

@pathawks
Copy link
Member

pathawks commented Aug 9, 2017

This is the test that is failing. I don't know how it could be related to the changes in this PR.

/cc: @benbalter

@benbalter
Copy link
Collaborator

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.

@BlythMeister
Copy link
Contributor Author

Changing liquid and documentation I can do.
Ruby...not so much 😋

@pathawks
Copy link
Member

pathawks commented Aug 9, 2017

Changing liquid and documentation I can do.
Ruby...not so much

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 👍

@benbalter
Copy link
Collaborator

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.

Fixed via #228

<meta name="twitter:card" content="summary" />
{% else %}
<meta name="twitter:card" content="summary_large_image" />
{% endif %}
Copy link
Collaborator

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.

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 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 🙂

Copy link
Collaborator

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.

Copy link
Contributor Author

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.

Copy link
Member

@DirtyF DirtyF Aug 22, 2017

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.

Copy link
Contributor Author

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.

Copy link
Contributor Author

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.

Copy link
Member

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 👍

<meta name="twitter:card" content="summary" />
{% else %}
<meta name="twitter:card" content="summary_large_image" />
{% endif %}
Copy link
Member

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 👍

@pathawks
Copy link
Member

@BlythMeister Sorry this has sat for so long. Ping me when you've made the changes and I will review.

@BlythMeister
Copy link
Contributor Author

@pathawks updates made as requested.

Copy link
Collaborator

@benbalter benbalter left a 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
Copy link
Member

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
@BlythMeister
Copy link
Contributor Author

@DirtyF updated to "summary" which is the smaller card

grrseguin added a commit to hl2/hl2.com that referenced this pull request Apr 24, 2018
Remove Facebook app ID
Applied workaround for twitter:card value
(see. jekyll/jekyll-seo-tag#225)
@BlythMeister
Copy link
Contributor Author

@DirtyF @benbalter @pathawks can this be put in now?

@pathawks
Copy link
Member

pathawks commented May 3, 2018

Awesome. Thanks for all your work on this! 👍🍻

@jekyllbot: :shipit: +minor

@jekyllbot jekyllbot merged commit 643c2db into jekyll:master May 3, 2018
jekyllbot added a commit that referenced this pull request May 3, 2018
@jekyll jekyll locked and limited conversation to collaborators May 3, 2019
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
5 participants