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

slash vs backslash error on Windows with Docpad generate --env static #518

Closed
jhuntdog opened this issue Jun 5, 2013 · 7 comments
Closed

Comments

@jhuntdog
Copy link

jhuntdog commented Jun 5, 2013

Result from docpad generate --env static on Windows can create links that include backslashes rather than slashes. The issue appears with links to files in subdirectories using eco language and is not present on Ubuntu.

Simplified directory structure includes sub-directories under documents like:

src/documents/
 | -- things
    | -- stuff
        | -- file1.html.eco
        | -- file2.html.eco
    | -- otherstuff
    | -- about.html.eco

Layout eco template generates links with something like:

<% for document in @getCollection('stuff').toJSON(): %>
    <a href="<%= document.url %>" property="dc:title">
<% end %>

Which on Windows, works fine with a docpad run. However, with docpad generate --env static, output link will look like: <a href="/things\stuff/file1.html">. Note the backslash.

On Ubuntu, same site and command will correctly generate /things/stuff/file1.html.

I'm not sure if this belongs here or with the eco plugin, so please forgive if in wrong place.

Docpad is awesome. Thank you.

@jhuntdog
Copy link
Author

To illustrate, I forked and very lightly modified the twitter bootstrap skeleton, repo. Modifications include removing the docpad-plugin-cleanruls and adding some pages in a "demo" collection.

I included the out directory, generated running a docpad generate --env static.

The backslashes can be seen in the generated demo page

@balupton
Copy link
Member

Thanks for the report. I currently do not have enough time to attend to this, so if you can look into it further and submit a pull request that would be great. Cheers :)

@jhuntdog
Copy link
Author

Okay. I'll see what I can figure out. Thanks.

@jhuntdog
Copy link
Author

I am more impressed with Docpad than ever! Though I haven't made enough progress to submit a pull request, I was able to quickly create a custom plugin, based on cleanurls, that fixes the issue.

The plugin system is amazing. Excellent work!

@balupton
Copy link
Member

Glad you've got a workaround. We should add some tests for this inside the docpad test suite, currently we don't have any nested directory tests.

balupton added a commit that referenced this issue Jun 14, 2013
@balupton
Copy link
Member

Fixed in the just released v6.42.1 :)

balupton added a commit that referenced this issue Jun 25, 2013
- v6.42.1 June 25, 2013
	- Fixed backslash and slash inconsistencies on windows
		- Thanks to [jhuntdog](https://github.com/jhuntdog) for [issue
#518](#518)
	- `docpad render` will no longer output warning levels
@jhuntdog
Copy link
Author

Thank you! I'm really liking all the recent Docpad developments and direction.

balupton added a commit that referenced this issue Oct 23, 2013
balupton added a commit that referenced this issue Oct 23, 2013
- v6.42.1 June 25, 2013
	- Fixed backslash and slash inconsistencies on windows
		- Thanks to [jhuntdog](https://github.com/jhuntdog) for [issue
#518](#518)
	- `docpad render` will no longer output warning levels
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants