« get me outta code hell

Inktober 2/3 - blog - My blog website - https://florrie.ed1.club
about summary refs log tree commit diff
path: root/build.js
diff options
context:
space:
mode:
authorFlorrie <towerofnix@gmail.com>2018-11-15 16:54:57 -0400
committerFlorrie <towerofnix@gmail.com>2018-11-15 16:54:57 -0400
commitec88b988d21f7ab8b8825c40fc77a661ad306a6d (patch)
treecc3ccb6e19693c8d1d31a676000666ebfa14e00b /build.js
parent5f98681a1760134a14bcf534033dbe30be3fd38a (diff)
Inktober 2/3
Diffstat (limited to 'build.js')
-rw-r--r--build.js5
1 files changed, 5 insertions, 0 deletions
diff --git a/build.js b/build.js
index a6efc7d..2be227c 100644
--- a/build.js
+++ b/build.js
@@ -84,6 +84,11 @@ async function build() {
   const posts = await Promise.all(postFiles.map(
     f => readFile('site/posts/' + f, 'utf-8').then(parsePostText)
       .then(post => {
+        if (post.config.permalink) {
+          console.error(`\n\x1b[1mWarning!\x1b[0m ${f} still has a manually-set permalink.`)
+        }
+
+        post.config.permalink = path.basename(f, '.md')
         parsedPostCount++
         process.stdout.write(`\r${Math.floor(parsedPostCount / postFiles.length * 100)}%`)
         return Object.assign(post, {sourceFile: f})