|
@@ -84,7 +84,11 @@ function extractMarkdown() {
|
|
|
(carry, f) => fs.readFileAsync('src/markdown/' + dir + '/' + f)
|
|
(carry, f) => fs.readFileAsync('src/markdown/' + dir + '/' + f)
|
|
|
.then(buf => buf.toString())
|
|
.then(buf => buf.toString())
|
|
|
.then(content => {
|
|
.then(content => {
|
|
|
- const title = path.basename(f, '.md');
|
|
|
|
|
|
|
+ const basename = path.basename(f, '.md');
|
|
|
|
|
+ const re = /(\d+)\. (.*)/;
|
|
|
|
|
+ const matches = basename.match(re);
|
|
|
|
|
+ const title = ! matches ? basename :
|
|
|
|
|
+ parseInt(matches[1], 10) + '. ' + matches[2];
|
|
|
return carry.concat({
|
|
return carry.concat({
|
|
|
title,
|
|
title,
|
|
|
path: '/' + slugify(title),
|
|
path: '/' + slugify(title),
|