From f6f83d7e7b872a3ada66c42d49766f23209a752e Mon Sep 17 00:00:00 2001 From: hotoo Date: Thu, 30 Oct 2014 20:50:37 +0800 Subject: [PATCH] Fixed template title --- index.js | 2 +- template/index.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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, ""); }); }); });