Skip to content

Commit

Permalink
fix: #139 remove DS path from attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
David Longworth committed Apr 3, 2017
1 parent 9b068d6 commit 80b6b69
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions dadi/lib/providers/markdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -147,13 +147,20 @@ MarkdownProvider.prototype.parseRawDataAsync = function parseRawDataAsync (data,
const parsedPath = path.parse(data[i]._name)

// Some info about the file
attributes._loc = data[i]._name
attributes._ext = parsedPath.ext
attributes._id = parsedPath.name
attributes._path = path.normalize(parsedPath.dir).split('/')
attributes._ext = parsedPath.ext
attributes._loc = data[i]._name

attributes._path =
parsedPath.dir.
replace(path.normalize(this.schema.datasource.source.path), '').
replace(/^\/|\/$/g, '').
split('/')

if (attributes._path == '') attributes._path = null


posts.push({
meta,
attributes,
original: data[i]._contents,
contentText,
Expand Down

0 comments on commit 80b6b69

Please sign in to comment.