summary refs log tree commit diff stats
path: root/src/modules
diff options
context:
space:
mode:
Diffstat (limited to 'src/modules')
-rw-r--r--src/modules/posts.js10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/modules/posts.js b/src/modules/posts.js
index 2d831af..834d45c 100644
--- a/src/modules/posts.js
+++ b/src/modules/posts.js
@@ -24,14 +24,16 @@ function canonicaliseMetadata (meta) {
   return meta
 }
 
-function get (filename) {
-  return canonicaliseMetadata(matter.read(filename, grayMatterOptions))
-}
-
 function getTitle (file) {
   return path.basename(file.path, path.extname(file.path))
 }
 
+function get (filename) {
+  const fileMatter = matter.read(filename, grayMatterOptions)
+  fileMatter.basename = getTitle(fileMatter)
+  return canonicaliseMetadata(fileMatter)
+}
+
 function getFolder (folder) {
   return new Map(
     fs