From 1f2a6245ab1e503dee017ab617aaeda816ecb383 Mon Sep 17 00:00:00 2001 From: Alan Pearce Date: Sun, 18 Jun 2017 14:12:25 +0200 Subject: feat: add tags endpoint --- src/modules/posts.js | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/modules') 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 -- cgit 1.4.1