-
Notifications
You must be signed in to change notification settings - Fork 3
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
Clear output folder on eleventy.build event #74
Conversation
It'd be nice to make this default to true but I need to look at the rest of the code to see what that entails
The |
First of all, thank you for your contribution! Can you elaborate a bit what's the use case, why is this behavior desirable? Cleanup during development, because there are always new files when changing anything in the template? Or more preventing to deploy old/not anymore used og images? |
Both, but mostly the first. I have found myself opening the OG folder in my editor to see how it looks, and having to either delete the old ones and trigger a fresh rebuild or just click through all the images to find the new ones has been really inconvenient. Thank you for this awesome plugin, by the way! It's so nice. |
Yeah, development process is currently quite a mess 😅. Curious if there would be even better alternatives than cleaning the directory. I will look into it later. |
Somehow I missed it the first time
There may be. I'm fine even if this is rejected--I realized I can put this same logic directly into my site's config, so I did that and it works great. 😅 But, to me, not keeping both old and new images does seem like the ideal behavior for the plugin. |
(Also, apologies for not linting my code before submitting the PR 🙈 ) |
This eliminates the need for the `clean:og` NPM script. See also [KiwiKilian/eleventy-plugin-og-image#74](KiwiKilian/eleventy-plugin-og-image#74)
Suggestion from @KiwiKilian Co-authored-by: Kilian Finger <hey@kilianfinger.com>
Co-authored-by: Kilian Finger <hey@kilianfinger.com>
# [1.6.0](v1.5.0...v1.6.0) (2023-02-23) ### Features * clear outputDir on eleventy.build event ([#74](#74)) ([3e60531](3e60531))
Had to apply some force to change the commit message after GitHub mobile didn't ask me how the merge commit should be name 🙈 – anyways it's released now! Thanks for your help 🙏 |
This adds an
emptyOutputOnRebuild
flag that would clear the OG image directory when Eleventy rebuilds. I haven't had a chance to test this yet--gonna do that tonight.If you want, I can change this to default to true.