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

fix(seo): correct social preview image path inside <meta> tag #1623

Merged
merged 1 commit into from
Mar 22, 2024

Conversation

cotes2020
Copy link
Owner

@cotes2020 cotes2020 commented Mar 22, 2024

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Issue

When a cross-domain site.img_cdn is set and the default site-wide social image URL (site.social_preview_image) is a local path, the URL of the social preview image inside the SEO tag is incorrect.

Input

# _config.yml
img_cdn: https://chirpy-img.netlify.app
social_preview_image: /commons/devices-mockup.png

Output

<!-- The HTML page source -->
<meta property="og:image" content="https://chirpy.cotes.pagehttps://chirpy.cotes.page/commons/devices-mockup.png">
<meta property="twitter:image" content="https://chirpy.cotes.pagehttps://chirpy-img.netlify.app/commons/devices-mockup.png">

What's changed

This PR corrects the logic of _includes/img-url.html to fix the above issue.

@cotes2020 cotes2020 marked this pull request as ready for review March 22, 2024 19:27
@cotes2020 cotes2020 merged commit 74cf57a into hotfix/6.5.4 Mar 22, 2024
7 of 8 checks passed
@cotes2020 cotes2020 deleted the fix-twitter-img branch March 22, 2024 19:32
kimbob13 pushed a commit to kimbob13/kimbob13.github.io that referenced this pull request May 25, 2024
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.

1 participant