static-dev / spike

A modern static build tool, powered by webpack
http://spike.js.org
Other
470 stars 29 forks source link

error when layout is in another subfolder #81

Closed crivera closed 6 years ago

crivera commented 7 years ago

Hi

i have the following folder structure:

in result.html i am trying to add the layout.html like this:

which works fine in index.html i am trying to add the layout.html like this: which then gives me an error because in layout.html i refer to the header and footer like this: it seems like the path always goes from the current path of the file instead of the one from where i am at. does that make sense? in result.html it works fine because ../fragments/header.html is a valid path. in index.html it does not work fine because ../fragments/header.html does not exist (its going above the views folder) do you guys have an idea how to fix that without creating multiple layout files?
jescalan commented 6 years ago

Yep, you can use the root option in htmlStandards to resolve from an absolute path 😁

https://github.com/reshape/standard#options

crivera commented 6 years ago

awesome that worked !