-
Notifications
You must be signed in to change notification settings - Fork 2
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
Remove or make optional the og:image path check #87
Comments
Removing the check isnt a good solution. I just saw the check uses a fixed dist path relative to the current working directory. This should be changed to the dist directory supplied by Astro src/hook.ts
|
Yep that’s pretty much the 3rd solution I suggested in the OP Should be an easy fix |
https://docs.astro.build/de/reference/integrations-reference/#dir-option |
I think line 63 of src/hook.ts just needs to be adjusted. Im not sure though as i cannot test this rn. - pngFile = pngFile.replace(path.join(process.cwd(), "dist"), "").replace(/\\/g, "/");
+ pngFile = pngFile.replace(fileURLToPath(dir), "").replace(/\\/g, "/"); |
I'd like to keep this check in. It's an easy way to us to ensure that the library is working as intended and that users have correctly configured the library. I originally added the check because I saw users not using the correct URLs, but it also prevents regressions in the plugin itself. I think your suggestion of considering the output dir would make the most sense. I'd be happy to merge in a PR, and it would be even better if you could also add in a new site into the |
Hi and thanks for this plugin, this is definetly the best OG plugin for astro as its super flexible - I love the approach of using React and tailwind to create presets.
But I am running into an issue in my monorepo:
Issue
I don't think that this check is neccessary
Rationale
Once the plugin has been properly wired this check should really never fail - the only time it prevents foot guns is when a user is trying out the plugin for the first time.
And at that stage surely the user can just check their app locally to make sure all the og:image tags are correct?
Main reason
This entirely locks out users who run astro in a monorepo. The assumptiuon that
This code will produce the same url structure on every system is incorrect, for me my built outputs live at ../../dist/apps/myapp/index.html
so this outputDir is not being taken into consideration
Solutions
Workaround
I am just using patch-package to remove this check , but I would be happy to contribute a fix upstream once a decision has been made to the best approach
The text was updated successfully, but these errors were encountered: