Skip to content

Conversation

@mattpopovich
Copy link
Contributor

@mattpopovich mattpopovich commented Nov 21, 2024

Type of change

  • New feature (non-breaking change which adds functionality)
  • Documentation update

Description

I was looking for a way to hide a post's image from the top of the post but still have it show on the home page and whenever it is shared in socials. This was mainly because I wanted the first part of the post to embed a corresponding YouTube video and I didn't want the post image and YouTube video to be displayed right next to each other, effectively showing the same things twice.

I found this discussion post from someone else that is asking how to do this exact thing, and followed the suggestions there and made it into a PR.

Additional context

This PR successfully hides the image from being shown at the top of the post.

  • However, I'm unsure if this prevents the image from being shown when sharing via socials. It seems to be working via a "social share preview" browser extension but I'm not sure where og:image is being set, so please confirm that og:image is set correctly before merging.

@mattpopovich mattpopovich force-pushed the hide-image-in-post branch 3 times, most recently from 5757a5d to 824a277 Compare November 21, 2024 19:08
@mattpopovich mattpopovich marked this pull request as ready for review November 23, 2024 01:05
Copy link
Owner

@cotes2020 cotes2020 left a comment

Choose a reason for hiding this comment

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

This change complicates the preview image and may cause confusion. Instead of hiding the top image in the post body, it would be better to display the embedded video as a link.

For the og:image issue, I don't have the energy to delve into it right now, so you'll have to resolve it yourself. You can check the code in _includes/head.html and the API of the jekyll-seo-tag plugin, and I'm sure you'll find some clues.

@mattpopovich
Copy link
Contributor Author

Ok. I hoped that by making it an "opt-in" change (if you don't want to use it, no changes are needed), that would reduce confusion.

Sounds like you are not interested in integrating this to the baseline, so I will close this PR.

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.

2 participants