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

Add logo and meta tags for twitter_cards #345

Merged
merged 1 commit into from
Jul 29, 2020
Merged

Add logo and meta tags for twitter_cards #345

merged 1 commit into from
Jul 29, 2020

Conversation

joelachance
Copy link
Collaborator

Adds meta tags for twitter cards.

It looks like the card validator won't show the image, but it's because the URL is still looking at localhost (ngrok isn't that good!)

Card Validator: https://cards-dev.twitter.com/validator

Complementary screenshot:
Screen Shot 2020-07-28 at 8 25 54 PM

@InessaPawson, to change what shows up in the card, you'll want to edit the description and image under the params object in the config.yaml. See examples here: https://gohugo.io/templates/internal/#twitter-cards

@rgommers, I don't know if we have some kind of staging any longer (I know our staging deployment site never worked that great), but it would be great to test it out there if possible. Otherwise, this is a pretty minor change that doesn't effect the site, only twitter cards.

Copy link
Member

@rgommers rgommers left a comment

Choose a reason for hiding this comment

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

Thanks Joe, LGTM.

@rgommers
Copy link
Member

@rgommers, I don't know if we have some kind of staging any longer (I know our staging deployment site never worked that great), but it would be great to test it out there if possible.

No, Surge never worked well. This isn't too hard, I'll open an issue and find a volunteer to set this up again, probably on Netlify.

@rgommers rgommers merged commit a365355 into master Jul 29, 2020
@rgommers rgommers deleted the twitter-cards branch July 29, 2020 09:01
@InessaPawson
Copy link
Member

@joelachance Thank you for looking into it! I tested it on Twitter and Facebook, and it doesn’t seem to be working. Could you check again on your end?

@joelachance
Copy link
Collaborator Author

I'm not getting anything showing up in the card validator for https://numpy.org either. I looked on the site and wasn't finding anything pertaining to this in the head element, would this have been deployed, @rgommers?

@rgommers
Copy link
Member

rgommers commented Aug 9, 2020

Yep, it's not deployed - I have an open PR with a deploy method, but didn't merge it yet. Now that we have good preview with Netlify, I think we can switch to auto-deploying. It requires everyone who merges a PR to make sure things actually work, but I think we can trust everyone with that. It will save a lot of hassle to have auto-deployment. I'll look at finishing that up now.

@InessaPawson
Copy link
Member

I'm back at it.:) My apologies.
This is how the cards show on Twitter and Facebook:

numpyorg_fb

numpyorg_twitter

The things I've tried so far:

  1. Checked the image path. It is valid.
  2. Checked robots.txt. There isn’t one.

@rgommers
Copy link
Member

Card validator says:

image

And this is consistent what I see on Twitter right now. Current master is just deployed now, so the logo should hopefully show up later today. If not, something may be incomplete in this PR.

@joelachance
Copy link
Collaborator Author

Ok, I looked into this, and I think this is an issue with Hugo's twitter template. We point images to twitter cards using (in the config)

params
  images:
  - logos/numpy.svg

We refer to our logo using that same path everywhere, and it works everywhere (except Twitter!). The difference between the Twitter image path and the rest of them is that they render in the browser a bit differently.

Twitter meta data: https://numpy.org/logos/numpy.svg
Everywhere else: https://numpy.org/images/logos/numpy.svg

Note the missing /images.

I'm updating the params.images to include /images, and hoping this will fix it. See PR #357.

@InessaPawson
Copy link
Member

Thank you for looking into it, Joe!
Seemingly a minor defect, it will be coming up over and over again as an issue given how active our user community is on social media, especially on Twitter, LinkedIn, and Facebook.

This was referenced Aug 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants