-
Notifications
You must be signed in to change notification settings - Fork 67
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
Generated paths point to root of my HDD #25
Comments
The project above build successfully with. metalsmith-permalinks |
Running into a similar issue. Recently started getting this the following error. No errors when I remove metalsmith-permalinks.
Why is permalinks attempting to access root? |
The pattern appears to be my problem. Do you still get errors if you change the pattern from
to this:
I don't get any build errors when I remove collection from the pattern. If not, is the problem metalsmith-permalinks or metalsmith-collections? |
Looks like my issue might have been different after all. Just in case it helps: I had one of my collections patterns prefixed with a "/" and that was causing the root issue. Changed this:
to this and no more errors:
|
@brndnb I'm having the same issue,
Unfortunately no prefixed slash for me. |
i had the same issue. Adding |
I have a similar folder structure as the tutorial mentioned by @vorg. I had the same issue when trying to build but it was only with the |
I have the same exact issue, and after a bit of debugging I've determined the cause: The code from the tutorial is: Metalsmith(__dirname)
.use(collections({
pages : {
pattern : 'content/pages/*.md'
},
posts : {
pattern : 'content/posts/*.md',
sortBy : 'date',
reverse : true
}
}))
.use(permalinks({
pattern : ':collection/:title'
}))
... The issue was seen in the file blogRoot/src/index.md,since this file didn't match a 'collection' pattern the permalink was '/home/index.html' (the root of the file system) Adding However, I think this issue should still be addressed in this plugin in a more flexible way this pull request attempts to fix the issue. But in my opinion, it too tightly couples different modules that don't need to know about each other. Maybe a better solution would be to do something like (just a proposed solution not actual working code): .use(permalinks({
pattern : ':collection/:title',
ignore: function(patternPart){
return typeof patternPart === 'undefined';
}
})) where the ignore function would also remove any following slashes. |
If this is happening to you after adding |
Just had this issue myself, found it to be a leading |
Is the solution still to add the |
|
Fix #25, all falsy pattern values and empty arrays are now treated the same
I'm trying to build my project by following this tutorial and I get this error:
Obviously node doesn't have access to crate folders in root of my HDD
My project tree
Used modules
Metalsmith config
The text was updated successfully, but these errors were encountered: