Commit 08eb31db authored by wu-lee's avatar wu-lee

metalsmith.js - only trim .md, .html from titles

parent efe430c0
......@@ -50,7 +50,7 @@ function pathToTitle(path, truncate = true) {
path = path.splice(path.length-1);
return path.map(
c =>
c.replace(/[.][^.]*/, '')
c.replace(/[.](md|html)$/, '')
.replace(/^(.)/, (_, ch) => ch.toUpperCase())
.replace(/-(.?)/g, (_, ch) => ' '+ch.toUpperCase())
).join('/');
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment