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

Permalinks should never try to create a folder outside(above) of Metalsmith(__dirname) #41

Closed
nikmartin opened this issue Oct 25, 2015 · 2 comments
Milestone

Comments

@nikmartin
Copy link

Related to #25:

.use(permalinks({
    relative: false,
    pattern: ':collection/:title'
  }))

will try to create about.md, which is NOT in a collection, as /about/index.html, which is the root of the drive on a LInux or OS X system. changing it to:

.use(permalinks({
    relative: false,
    pattern: './:collection/:title'
  }))

makes it relative to something, which happens to be the root of the build dir. What should probably happen is permalinks should always build paths relative to the build dir.

@IanMercer
Copy link

It would be preferable if the plugin code actually prevented the accidental use of a / at the start of a pattern. After getting the path maybe something like:

  // Remove leading / to avoid escaping to the root folder!!
  if (path.indexOf('/') === 0){
        path = path.substring(1);
  }

@webketje webketje added this to the 3.0.0 milestone Aug 4, 2022
@webketje webketje mentioned this issue Aug 4, 2022
6 tasks
@webketje
Copy link
Member

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

3 participants