metalsmith / layouts

A metalsmith plugin for layouts
MIT License
116 stars 49 forks source link

Replace backslashes in partial names with expected forward slashes #82

Closed GRUBES closed 8 years ago

GRUBES commented 8 years ago

When registering partials on a Windows machine, because partial names are derived using path.join, the names would contain backslashes, as mentioned in #78

This quick fix ensures that there are never backslashes in the partial name, replacing them with the expected forward slashes. The path to the partial file itself is left untouched so that it remains cross-platform.

GRUBES commented 8 years ago

Working on an associated test, but it's a little strange since it would really only fail on Windows, never on *nix.

Also noted that the following tests fail on Windows because of line breaks:

lewisbellwood commented 8 years ago

Thanks for a great plugin. Just wanted to know when is this likely to be merged into the main branch as we are setting up a project that requires both mac and windows to work on this project.

ismay commented 8 years ago

@lewisbellwood

I was thinking about how to do testing for windows as well as unix, but I'll do that later. This is a good fix in the meantime. Thanks @GRUBES

lewisbellwood commented 8 years ago

thanks @ismay for the fix. I had already patched my local version with fix. but will this be auto updated on npm?

ismay commented 8 years ago

@lewisbellwood np 👍 , yeah I just published it, so it should be installable now!