diff --git a/index.js b/index.js index 9ee37bc..4d8caed 100644 --- a/index.js +++ b/index.js @@ -25,7 +25,7 @@ function build(cwd, options){ del(dist_dir, function(){ gulp.src(path.join(template_dir, '**'), { dot: true }) - .pipe(replace('{FILE_NANE}', path.basename(fileName) )) + .pipe(replace(/\{FILE_NANE\}/g, path.basename(fileName) )) .pipe(gulp.dest(dist_dir)); gulp.src(path.join(cwd, fileName)) diff --git a/template/index.html b/template/index.html index e4856d5..ad2cfa2 100644 --- a/template/index.html +++ b/template/index.html @@ -32,7 +32,7 @@ $.get("{FILE_NANE}", function(markdown){ var mark = new Markline("#life", markdown); mark.render(); - document.title = mark.data.title; + document.title = (mark.data.title || "{FILE_NANE}").replace(/<[^>]+>/g, ""); }); }); });