Commit 221d2a0
committed
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.1 parent 1bd737d commit 221d2a0
1 file changed
+10
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
37 | 46 | | |
38 | 47 | | |
39 | 48 | | |
| |||
0 commit comments