fix: replace all space in slug with dash

This commit is contained in:
Timothy 2021-01-28 23:20:31 +08:00
parent c9c4cb04c0
commit a9bf55dbb3

View File

@ -7,7 +7,7 @@ const ext = typeof args[1] !== 'undefined' ? args[1] : 'mdx'
const fileName = title
.toLowerCase()
.replace(/[^a-zA-Z0-9 ]/g, '')
.replace(' ', '-')
.replace(/ /g, '-')
let d = new Date()
const date = [
d.getFullYear(),