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

Improve the Open Graph tags for Twitter/X #17

Merged
merged 18 commits into from
Sep 26, 2024

Conversation

conradolandia
Copy link
Collaborator

The current implementation of Open Graph tags is not working properly. Even when sharing the url of the blog on X, the tags used are the Home page tags, as you can see in metatags.io.

According to https://developer.x.com/en/docs/x-for-websites/cards/guides/getting-started the use of og:image and similar is supported. However, this post in StackOverflow affirms that "Twitter likes name, not property". So, I'm trying that.

Also, the description is being repeated in the title, so I'm trying to construct a different description. Input on this matter is appreciated, to have a proper long description for the home page, the about page and the blog.

This PR is an attempt of solving these issues.

…ata tags to the object, and use those. Alter the values of some metadata tags
Copy link

netlify bot commented Sep 20, 2024

Deploy Preview for spyder-svelte-website-preview ready!

Name Link
🔨 Latest commit 24c9bfd
🔍 Latest deploy log https://app.netlify.com/sites/spyder-svelte-website-preview/deploys/66f48e3d573d220008fc6e5d
😎 Deploy Preview https://deploy-preview-17--spyder-svelte-website-preview.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@conradolandia conradolandia marked this pull request as draft September 20, 2024 22:23
@CAM-Gerlach
Copy link
Member

Wait...the two 1080p preview PNGs in #7 were 8 Megabytes? 🤦 🤦 🤦 I'm not sure how I missed that, but I did get rather complacent since unlike most others whom I always carefully scrutinize for image size and optimization issues, you've been very good at optimizing your images before submitting them. And judging from the fact that it took me a while to convince myself I was reading it correctly even after noticing on this PR, I must have assumed I was looking at kB, not MB. It seems all three of us missed it, and we don't yet have our pre-commit file size check on this repo which (at least in theory) would have warned us. Since given each of these two images were nearly the size of the entire repo (including all the existing files, assets and blog images, GIFs, videos, etc) prior to their committal, and roughly tripled its size.

Anyway, nothing we can do to fix it now except each be more careful to ensure it doesn't happen again. If we let even one of these incidents a year, we're likely facing a repo size of well over 100 MB after 5 years, around the size of the Spyder repo after over 15 years and ≈30,000 commits to master.

@conradolandia
Copy link
Collaborator Author

You are correct in that, usually I avoid big files also, and I have no excuses. I just missed it, will be more careful with that.

@CAM-Gerlach
Copy link
Member

Yeah, we all missed it. Hopefully now that spyder-ide/spyder-docs#383 is in, I can get at least a basic suite of pre-commit checks ported over here soon that can catch that and other things.

@CAM-Gerlach
Copy link
Member

@conradolandia I see these files were changed from 2 to 4 space indents. Given this results in much more verbose, noisier changes and masks the substantive ones, and is not consistent with the other files I checked nor how HTML, CSS, JS, templates, etc. are formatted in other Spyder web-related repos, was this an accidental mistake?

@conradolandia
Copy link
Collaborator Author

conradolandia commented Sep 23, 2024

Yes, this was an accidental mistake. I changed editor and the new editor did what it wanted, I found out late. I will fix it.

@conradolandia
Copy link
Collaborator Author

I consider this PR ready for review. This will show the blog image and post metadata if sharing individual posts, and will show correct metadata for each individual page that provides metadata. The downside of this solution is that generates some code repetition, but I will take this solution as the best for now. I will leave the dynamic generation of OG images for each blog post for another PR, and maybe will centralize the meta tags in the general layout again.

@conradolandia conradolandia marked this pull request as ready for review September 26, 2024 00:01
@ccordoba12 ccordoba12 changed the title Try to improve the Open Graph tags specificaly for twitter/X Improve the Open Graph tags for Twitter/X Sep 26, 2024
Copy link
Member

@ccordoba12 ccordoba12 left a comment

Choose a reason for hiding this comment

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

It's working as expected, so it looks good to me.

Great work @conradolandia!

@conradolandia conradolandia merged commit f793676 into spyder-ide:main Sep 26, 2024
2 checks passed
@conradolandia conradolandia deleted the better-og branch September 26, 2024 02:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants