-
Notifications
You must be signed in to change notification settings - Fork 10.3k
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
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
gatsby-plugin-sharp
/ gatsby-remark-images
: Set destination directory with destinationDir option
#27153
Comments
This makes a lot of sense. Happy to receive a PR adding this! |
Nice! Could you weigh in on where the changes should be made? In |
@karlhorky could you tell us more about tooling that would be beneficial here? I feel that adding an option Users can easily set it to |
@wardpeet in lieu of an Asset Manifest (see #20745), I would like the built assets to better match the inputs - eg. that output images be under the same paths as the input images:
This is in order to achieve server-side authentication and access control to the built assets - eg. #1100 (comment)
This is a good point, and maybe also something that should be applied to the Maybe one way of doing this would be to require and validate that the content hash be used somewhere in the filename? We could do this by running the function and making sure that the argument is being used, à la:
But instead of validating that EITHER the |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
not stale |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
not stale |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
lol such a stale bot not stale |
Hiya! This issue has gone quiet. Spooky quiet. 👻 We get a lot of issues, so we currently close issues after 60 days of inactivity. It’s been at least 20 days since the last update here. Thanks for being a part of the Gatsby community! 💪💜 |
That's interesting, I'm still hesitant to enable this behavior as I don't fully understand the complications that this will bring. Technically we could start with adding outputDir to Would it help if you got a list of assets per route? |
Well, as long as the Original Path
Before
After (without Here the first The name Config:
After (with Config:
|
Sure, that would solve it a different way. That would be my request over at #20745 |
I feel there are more use-cases for a manifest file than there might be for renaming files. This would indicate that these files are part of a route, so part of webpack or page-data |
Yeah definitely, I think there are some use cases for sure for a full asset manifest. Right now I'm using the information in Back then I made a list of all the things that I found missing from |
The project that I'm using it in is this |
This issue was moved to a discussion.
You can continue the conversation there. Go to discussion →
Summary
For the plugins
gatsby-plugin-sharp
and/orgatsby-remark-images
(whichever makes sense and is necessary), an optiondestinationDir
(string or function) that works similarly to the option ingatsby-remark-copy-linked-files
......also with the new
relativeDirectory
property in the returned file object:Basic example
See examples above.
Motivation
The structure of the files in the output
public
folder is more configurable and using therelativeDirectory
option, can also match 1 to 1 the folder structure of the inputsrc/pages
directory. This makes the output easier to reason about and also easier to build tooling upon.The text was updated successfully, but these errors were encountered: