« get me outta code hell

blog - My blog website - https://florrie.ed1.club
about summary refs log tree commit diff
path: root/build.js
diff options
context:
space:
mode:
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})