sparkartgroup / gulp-markdown-to-json

Parse Markdown and YAML → compile Markdown to HTML → wrap it all up in JSON
MIT License
75 stars 14 forks source link

'Single file style' dosen't print folders in json #12

Closed primalivet closed 8 years ago

primalivet commented 8 years ago

When using the 'single file style' from the readme I get the following json.

{
  "pages\\canoe-and-kayak": {
    "title": "Canoe and Kayak",
    "body": "<p>Lorem ipsum..."
  },
  "posts\\a-day-in-the-archipelago": {
    "title": "A Day in the Archipelago",
    "body": "<p>Lorem ipsum..."
  }
}

The output json I expected was

{
  "pages": {
    "canoe-and-kayak": {
      "title": "Canoe and Kayak",
      "body": "<p>Lorem ipsum..."
    },
    "next-post" : {
      "title": "...",
      "body": "..."
    }
  },
  "posts": {
    "a-day-in-the-archipelago": {
      "title": "A Day in the Archipelago",
      "body": "<p>Lorem ipsum..."
    }  
  }
}

My gulp task looks like this.

gulp.task('posts', function() {
  gulp.src('./content/**/*.md')
    .pipe(gutil.buffer())
    .pipe(markdown('index.json'))
    .pipe(gulp.dest('./public'))
});

and my folder stuckture is

'./content/pages/file.md' and './content/posts/file.md'

Im on Windows 7 and using Atom if that helps.

pushred commented 8 years ago

Fixed by https://github.com/SparkartGroupInc/gulp-markdown-to-json/commit/fd8b7e651a95f27f837423e235a29d90624f2093