-
-
Notifications
You must be signed in to change notification settings - Fork 76
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
Allow setting includes directory and non-absolute copy #111
Conversation
About the option to configure the And about the |
Updated all Regarding That said, this is not correct yet, the watch on serve stopped working on assets once I did that. Looking into that now. |
Found it. |
Fixed it :) |
argh. The copy is still not working properly. Now it detects the change, but it doesn't copy the correct files on change. |
Fixed. :) |
I'm not absolutely convinced about |
I've testing the Sorry but I'm going to revert this change. Some ideas:
What do you think? |
Hmmmmmmmmm. Okey. What do you think about doing the opposite then? We keep And we add a path to be the "page dir" (that by default is |
Mmmm, that's could be complex too. I'm doing some testing with symlinks, so I think it's the most clean and easy way. Just create a symlink in your src folder pointing to external sources. Does it fit to you? |
Yes, sure, symlink solves it. Maybe I could also solve this by either setting a URL data function that removes the top level dir or by changing the URLs on beforeBuild/beforeUpdate? |
FWIW, I agree with creating "helper" functions as scripts to do anything complex outside of |
If the problem is just the url, the most easy way is creating a url function in a export function url(page) {
let url = page.dest.path + page.dest.url;
return url.replace("/basepath", "");
} |
Just came here to write this. :) But I did export function url(page) {
page.dest.path = page.dest.path.replace(/^\/basepath\//, '/');
} instead. So it still uses prettyUrls. |
This PR adds a
includes
option to change the_includes
directory and allowssite.copy()
to copy from directories relative tosrc
(dest is still absolute).The rationale behind this is: for one of my projects, I have loads of top level files, I want to keep them in a subdirectory. When I change
src
, I'm kinda forced to change my assets and _include, because they "follow" the src. With this change, I'm able to specifyincludes: "../_includes"
andsite.copy('../assets', 'assets')
.Alternatively, we could make those two (includes and copy) to be relative to the execution, but I'm not sure that's a good idea, because it breaks the "I want to isolate a build" use case.