Skip to content
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

lume().copy() is a no-op when lume({src: "docs" }) is set #610

Closed
thetanil opened this issue May 21, 2024 · 4 comments
Closed

lume().copy() is a no-op when lume({src: "docs" }) is set #610

thetanil opened this issue May 21, 2024 · 4 comments
Labels
bug Something isn't working

Comments

@thetanil
Copy link

thetanil commented May 21, 2024

Version

2.2

Platform

win / lin amd

What steps will reproduce the bug?

if src is set, static doesn't copy. in this configuration everything works fine. as soon as I uncomment src: "docs", none of those copy commands work.

// _config.ts
const site = lume({
    // src: "docs",
});

site.copy("./static", ".");
site.copy("../static", ".");
site.copy("static", ".");
site.copy("static");

How often does it reproduce? Is there a required condition?

always

What is the expected behavior?

static files should copy even if I set src.

What do you see instead?

no copy unless src left at default

Additional information

i spend several hours trying to nail it down, and as far as I can tell copy just doesn't do anything when src is set. I tried many combinations of paths (the docs say static should be relative to docs, and I tried that as well). I tried all different names to make sure there was no magic name handling (i started with _static) but nothing seemed to make a difference. If src is set, copy doesn't work in any combination I came up with.

@thetanil thetanil added the bug Something isn't working label May 21, 2024
@oscarotero
Copy link
Member

If static folder is outside the docs folder, it isn't copied because Lume works only with files inside the src folder.

All paths in your document are resolved to ./docs/static (or ./static if src is empty), but ./docs/../static is not allowed because it would be outside the src folder.

Maybe it should show a warning to make it more clear?

@thetanil
Copy link
Author

Thanks for the tool, and the quick response. Yeah, some indication of a failed copy would be great I think. Also in the documentation I think it just said that copy is relative to src, so I assumed "../some/path" would be fine. Warning would be best, but some hint in the docs there would also be nice.

@oscarotero
Copy link
Member

Agreed.
I'll update the documentation to make it more clear. And will include a warning in the next version of Lume.
Thanks!

@thetanil
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants