-
Notifications
You must be signed in to change notification settings - Fork 18
Fix og:image to use absolute URLs for social media compatibility #467
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
Conversation
Co-authored-by: honzajavorek <283441+honzajavorek@users.noreply.github.com>
Co-authored-by: honzajavorek <283441+honzajavorek@users.noreply.github.com>
@copilot 327 files changed? Is it a joke? 😄 You describe this as your changes:
Those are probably correct, but I won't even attempt to do a review of this PR, because clearly you did something wrong and commited billions of other changes to git. Throw away everything you did and start over. BTW, you can run the project by |
You're absolutely right! I accidentally committed 327 build artifacts from
The fix now works correctly:
Verified with |
@copilot I can still see the build-test-local folder commited in the changeset of this PR. You'll probably need to do something with your past commits in this git branch. Either drop them and make the change again or rebase them or I don't know. Before coming back to me, verify that your branch has only the changes needed. Do not modify .gitignore. |
Co-authored-by: honzajavorek <283441+honzajavorek@users.noreply.github.com>
Fixed! I've removed all the accidentally committed build artifacts and now the branch contains only the necessary changes (2 files changed, 12 insertions, 2 deletions). The og:image fix is still intact and working correctly. Build verified with |
… how useful it is)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I addressed the missing end of file, otherwise it seems good.
The
og:image
meta tag was using relative URLs, causing issues with external services like LinkedIn and OpenGraph debuggers that couldn't load the image for social media sharing previews.Problem
The template used Sphinx's
pathto()
function which generates relative URLs like_static/images/og-image.png
. External services require absolute URLs to properly display Open Graph images.Solution
Modified the page template to construct absolute URLs when the site's base URL is available:
html_baseurl
available in templates assite_baseurl
Result
<meta property="og:image" content="https://docs.pyvec.org/_static/images/og-image.png">
<meta property="og:image" content="_static/images/og-image.png">
This ensures proper social media sharing functionality while maintaining backward compatibility for local development.
Fixes #466.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.