Skip to content

Commit

Permalink
fix(jekyll-md): 生成文件名转换报错
Browse files Browse the repository at this point in the history
  • Loading branch information
StreakingMan committed May 15, 2022
1 parent 0f38593 commit a60964a
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions utils/file-generator.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,13 +7,10 @@ const ejs = require('ejs');

const jekyllMarkdownName = (title) => {
const now = new Date();
const year = now.getFullYear();
const month = now.getMonth() + 1;
const date = now.getDate();
return `${year}-${month.padStart(2, '0')}-${date.padStart(
2,
'0'
)}-${title.toLowerCase()}`;
const year = now.getFullYear().toString();
const month = (now.getMonth() + 1).toString().padStart(2, '0');
const date = now.getDate().toString().padStart(2, '0');
return `${year}-${month}-${date}-${title.toLowerCase()}`;
};

const generatorTemplateFileMap = {
Expand Down

0 comments on commit a60964a

Please sign in to comment.