Skip to content

Commit

Permalink
apply nitpicks
Browse files Browse the repository at this point in the history
  • Loading branch information
vishvamsinh28 committed Dec 17, 2024
1 parent 48010df commit 440670c
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion scripts/build-post-list.js
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,9 @@ async function isDirectory(dir) {
}

function capitalize(text) {
return text.replace(/(?:^|\s|-)([a-z])/g, (_, char) => char.toUpperCase())
return text.split(/[\s-]/)
.map(word => word.charAt(0).toUpperCase() + word.slice(1))
.join(' ');
}

module.exports = { slugifyToC, buildPostList }

0 comments on commit 440670c

Please sign in to comment.