Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Handle copying assets from assets-only directories
Fixes #39 Previously when Gatsby was copying assets in the post-build step, it assumed that all assets were in the same directory as an html page as page paths can be written programatically, to ensure assets are copied to the right directory, they too need to follow however the page path is modified. This created a bug however when assets were placed in a directory without a page as then the code couldn't find a page associated with the assets. This commit checks now if page is returned undefined and if it is, copies the asset to /public to a directory with the same name e.g. /pages/images/foo.jpg is copied to /public/images/foo.jpg.
- Loading branch information