summary refs log tree commit diff stats
path: root/src/modules
diff options
context:
space:
mode:
authorAlan Pearce2017-06-18 14:12:25 +0200
committerAlan Pearce2017-06-18 14:12:25 +0200
commit1f2a6245ab1e503dee017ab617aaeda816ecb383 (patch)
treeb8aa5820fa5661b652f5f55a9a1e48f9824241eb /src/modules
parent69af7f12ec17f0aba65b0e23ef4045ee28f2dac8 (diff)
downloadhomestead-1f2a6245ab1e503dee017ab617aaeda816ecb383.tar.lz
homestead-1f2a6245ab1e503dee017ab617aaeda816ecb383.tar.zst
homestead-1f2a6245ab1e503dee017ab617aaeda816ecb383.zip
feat: add tags endpoint
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