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

Test blog meta image path update #3161

Closed
wants to merge 9 commits into from

Conversation

julieg18
Copy link
Contributor

@julieg18 julieg18 commented Jan 7, 2022

Testing solution for #1238

@julieg18 julieg18 marked this pull request as draft January 7, 2022 21:44
@shcheklein shcheklein temporarily deployed to dvc-org-test-blog-meta--3dvfit January 7, 2022 21:45 Inactive
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 7, 2022 22:48 Inactive
@julieg18 julieg18 had a problem deploying to dvc-org-test-blog-meta--3dvfit January 8, 2022 03:11 Failure
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 8, 2022 03:14 Inactive
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 11, 2022 21:29 Inactive
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 13, 2022 15:10 Inactive
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 13, 2022 15:19 Inactive
@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 20, 2022 13:49 Inactive
// nodes.map(async node => {
// const imagePath = node.picture.gatsbyImageData.images.fallback.src
// const date = node.date.slice(0, 10)
// return copyFile(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

I commented out my original solution which involved copying over the images created by gatsby-plugin-image to a new place in the public folder. At the time copyFile runs, gatsby hasn't created all of the images yet so you get the can't find directory or file error on some of the images. Maybe we could look into having Gatsby creating the images earlier, guaranteeing they are already built when we run the copyFile code?

await Promise.all(
nodes.map(async node => {
const imagePath = node.picture.fields.sourcePath
return Jimp.read(path.join(__dirname, 'static', 'uploads', imagePath))
Copy link
Contributor Author

@julieg18 julieg18 Jan 21, 2022

Choose a reason for hiding this comment

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

Since I couldn't use copyFile, I used Jimp to take the main images and copy them over to the public folder. But if anyone has any ideas on getting the commented solution to work, it would be probably be better to just use gatsby-plugin-image and not use Jimp at all.

@julieg18 julieg18 temporarily deployed to dvc-org-test-blog-meta--3dvfit January 21, 2022 00:50 Inactive
@julieg18
Copy link
Contributor Author

Closing in favor of #3206

@julieg18 julieg18 closed this Jan 24, 2022
@julieg18 julieg18 deleted the test-blog-meta-image-path-update branch March 16, 2022 15:08
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