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 og:image path to be absolute #537

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

TristanCacqueray
Copy link
Contributor

This change resolves the relative note image path to make an absolute url.

For blog/post.md with a ![img](media/image.png), the og:image is:

  • Before: siteUrl/media/image.png
  • After: siteUrl/blog/media/image.png

@srid
Copy link
Owner

srid commented Jul 1, 2024

cc @shivaraj-bh

Copy link
Owner

@srid srid left a comment

Choose a reason for hiding this comment

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

I'm not entirely sure about this change. Been a while since I worked on Emanote, but IIRC link and image URLs are not always considered relative.

In any case, we need to tests before being able to make changes like this.

TristanCacqueray added a commit to TristanCacqueray/tristancacqueray.github.io that referenced this pull request Jul 1, 2024
@TristanCacqueray
Copy link
Contributor Author

In any case, we need to tests before being able to make changes like this.

You are absolutely right, let me convert this to a draft. There are other papercuts in the og:description that I'd like to fix (like wikilink not being rendered properly and the footnote). Is there an example test we could use to validate such fixes?

@TristanCacqueray TristanCacqueray marked this pull request as draft July 2, 2024 10:51
This change resolves the relative note image path to make
an absolute url.

For `blog/post.md` with a `![img](media/image.png)`, the og:image is:
- Before: `siteUrl/media/image.png`
- After:  `siteUrl/blog/media/image.png`
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