-
-
Notifications
You must be signed in to change notification settings - Fork 5.9k
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
og:image meta tag not generated correctly with img_path #754
Comments
Thanks for the report! The |
Hi @cotes2020! I deployed this update, but it still looks like the issue persists? My source still looking like this: <meta property="twitter:image" content="https://josh-ops.com/status-check.gif" />
<meta property="og:image" content="https://josh-ops.com/status-check.gif" /> I'm not using a CDN, which differs from what you're using in your instance, I believe. From this line: jekyll-theme-chirpy/_includes/head.html Line 25 in 4a18563
if I remove {% if seo_tags contains 'og:image' %} then it works: <meta property="og:image" content="http://localhost:4000/assets/screenshots/2022-10-12-using-github-checks-api/status-check.gif" />
<meta property="twitter:image" content="http://localhost:4000/assets/screenshots/2022-10-12-using-github-checks-api/status-check.gif" /> This also worked {% if site.img_cdn != empty and seo_tags contains 'og:image' %} Not really an expert in this, so not sure what the intent is with |
Ah, looks like I submitted a bad patch, thanks for testing. After more in-depth debugging, the same problem will occur if the |
@cotes2020 okay maybe one minor thing left here that I noticed investigating my source:
It looks like there is one last reference to the Nothing fails to load on the page, so it's more of a meta object/tag. What do you think? |
Are you confused by this line? jekyll-theme-chirpy/_includes/head.html Line 43 in 59b5562
Also, how are these contents obtained?
|
Yeah, kind of! I wasn't expecting to see a reference to an unreachable image in the above snippet.
when it should be
Just like how we (well, you) cleaned up the |
jekyll-theme-chirpy/_includes/head.html Line 43 in 59b5562
The above code can generate the correct URL no matter whether
Now I don't quite understand what you mean. Are you getting an incomplete URL path after testing 59b5562? If yes, please list the specific configuration: What are the values of |
Yes, I applied 59b5562, and that fixed the However, go to my post: https://josh-ops.com/posts/using-github-checks-api/ If you right click and view the source, you'll find a similar issue with the image:
This is in the Screen.Recording.2022-11-16.at.3.51.51.PM.movSo, I think there is one more thing that needs to be patched to fully fix this. I can't find where in the codebase this is coming from though :(. |
Like those SEO-related
Will fix it soon, thanks for the video demo. 👍 |
This issue occurs when setting the `img_path` of the post or the `baseurl` of the site configuration.
Ahhh - so actually, this made it worse for me, because I didn't have a So now it renders as:
When it should be:
I can fix this though in my posts - should I just plan to put a - img_path: /assets/screenshots/2022-10-12-using-github-checks-api
+ img_path: /assets/screenshots/2022-10-12-using-github-checks-api/ I think the logic here 59b5562 was slightly more robust, but now that I know how it works I am good with the solution of appending a Thanks for all of the debugging 🎉 |
By now, |
Works for me, thank you for confirming! Is there a way to update the post for something like this without modifying the "updated" time ? |
You can use git to merge the post's temporary commit into the previous commit. As a reminder, da7d7e2 supports |
Woot! It's all fixed now with da7d7e2 😄 🎉 Thanks @cotes2020!! |
This issue occurs when setting the `img_path` of the post or the `baseurl` of the site configuration.
This issue occurs when setting the `img_path` of the post or the `baseurl` of the site configuration.
This issue occurs when setting the `img_path` of the post or the `baseurl` of the site configuration.
This issue occurs when setting the `img_path` of the post or the `baseurl` of the site configuration. (cherry picked from commit f6e9a3f)
Checklist
master
branch.Describe the bug
It looks like the image post works when using
img_path
(ie: using the short path), but theog:image
meta tag doesn't render correctly.See my example post.
The title image shows up correctly in the post, but because I am using
img_path
, it doesn't seem that theog:image
tag renders correctly.Markdown:
If searching the source of the page, you will find:
The image should be:
At least according to the docs, this should work:
To Reproduce
Steps to reproduce the behavior:
img_path
og:image
tagExpected behavior
Using correct version of image path
Screenshots
n/a
Environment
ruby -v
gem -v
bundle -v
bundle exec jekyll -v
bundle info jekyll-theme-chirpy
Desktop
macOS latest
Chrome latest
Smartphone
n/a
Additional context
cc joshjohanning/joshjohanning.github.io#21 and credits to @ruzickap
The text was updated successfully, but these errors were encountered: