Skip to content

Commit

Permalink
Files can now be included from other places than source/includes.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matias Larsson authored and Matias Larsson committed Nov 19, 2018
1 parent 3cb80a5 commit bda76ad
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ function javascript_include_tag(include) {
}

function partial(include) {
var includeStr = safeReadFileSync(path.join(__dirname, '/source/includes/_' + include + '.md'), 'utf8');
var includePath = "";
if (include.indexOf("/") === 0) {
includePath = path.join(__dirname, include + '.md');
}
else {
includePath = path.join(__dirname, '/source/includes/_' + include + '.md');
}
var includeStr = safeReadFileSync(includePath, 'utf8');
return postProcess(md.render(clean(includeStr)));
}

Expand Down

0 comments on commit bda76ad

Please sign in to comment.