Skip to content

Commit

Permalink
默认生成html
Browse files Browse the repository at this point in the history
  • Loading branch information
ksky521 committed Jun 17, 2017
1 parent cc526fa commit 6ff343c
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
/test
/3th
/.idea
/.vscode

/npm-debug.log

/output
/publish
6 changes: 3 additions & 3 deletions lib/generate.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,12 @@ function generate(filepath, outputDir, rDir) {
title = filename;
}

var url = filename.replace(/\.(?:md|markdown)$/i, '.htm');
var url = filename.replace(/\.(?:md|markdown)$/i, '.html');
indexList += '<li><a class="star" href="' + url + '" target="_blank">' + title + '</a> &nbsp; [<a href="' + url + '?_multiscreen=1" target="_blank" title="多窗口打开">多窗口</a>]</li>';

copyLinkToOutput(content, filepath, outputDir, rDir);
html = handlerHTML(html, rDir);
$.writeFile(path.join(outputDir, filename.replace(/\.(?:md|markdown)$/i, '.htm')), html);
$.writeFile(path.join(outputDir, filename.replace(/\.(?:md|markdown)$/i, '.html')), html);
}
return false;
}
Expand Down Expand Up @@ -109,7 +109,7 @@ function generate(filepath, outputDir, rDir) {
});
if (html) {
html = handlerHTML(html, rDir);
$.writeFile(path.join(outputDir, filename.replace(/\.(?:md|markdown)$/i, '.htm')), html);
$.writeFile(path.join(outputDir, filename.replace(/\.(?:md|markdown)$/i, '.html')), html);
}
}
}
Expand Down

0 comments on commit 6ff343c

Please sign in to comment.