pidgin/nest

Changes to `update-lastmod`

2019-06-06, Jason
954a8c86ba9e
Parents 14a004a99ec9
Children 49cb32dd5d44
Changes to `update-lastmod`

* Change yaml dump indent from 4 to 2
* Wrtie first commit date as well
--- a/tools/update-lastmod.js Thu Jun 06 15:58:59 2019 +0100
+++ b/tools/update-lastmod.js Thu Jun 06 16:10:56 2019 +0100
@@ -21,7 +21,7 @@
const mdRegex = /\.md$/
const hgLogArgs = ['log', '--follow', '--pager', 'never', '--color', 'never']
-const yamlDumpSettings = { indent: 4 }
+const yamlDumpSettings = { indent: 2 }
/*****************************************************************************
* Execution
@@ -34,8 +34,9 @@
getFrontMatter(file),
])
const lastmod = commits[0].date
+ const date = commits[commits.length - 1].date
const newFrontString = yaml
- .dump({ ...attributes, lastmod }, yamlDumpSettings)
+ .dump({ ...attributes, lastmod, date }, yamlDumpSettings)
.trim()
const output = `---\n${newFrontString}\n---\n\n${body}`