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

Copying an underscored file removes the underscore #569

Closed
cgwrench opened this issue Feb 12, 2024 · 3 comments
Closed

Copying an underscored file removes the underscore #569

cgwrench opened this issue Feb 12, 2024 · 3 comments
Labels
bug Something isn't working
Milestone

Comments

@cgwrench
Copy link
Contributor

Version

v2.0.3

Platform

Windows

What steps will reproduce the bug?

I'm trying to copy a file whose filename begins with an underscore, like the following example from the docs:

// Copy a underscored file
site.copy("_headers");

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

No response

What is the expected behavior?

I'd expect to see a _headers file in the _site output directory.

What do you see instead?

Instead, I see a headers file (note the missling leading underscore).

Additional information

Is this the expected behaviour? If so, how can I copy a file and retain it's leading underscore?

@cgwrench cgwrench added the bug Something isn't working label Feb 12, 2024
@oscarotero
Copy link
Member

Hmm, I guess you're using the slugifyUrls plugin, right? By default, this plugin slugify the url of all files, and I could confirm that _headers is converted to headers.
I have to think of a good solution for this use case, but for now, you can configure the plugin to only slugify html pages:

site.use(slugifyUrls({
  extensions: [".html"]
}));

@cgwrench
Copy link
Contributor Author

I am using the slugifyUrls plugin. This behaviour is a little surprising, but thanks for the explanation and workaround.

@oscarotero
Copy link
Member

Yes, I'm agree that this behavior is not right. I'll change it in the next lume version

@oscarotero oscarotero added this to the 2.1.0 milestone Feb 12, 2024
@oscarotero oscarotero reopened this Feb 12, 2024
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