about 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.js (renamed from src/modules/metadata.js)13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/modules/metadata.js b/src/modules/posts.js
index f35031d..e005103 100644
--- a/src/modules/metadata.js
+++ b/src/modules/posts.js
@@ -24,18 +24,15 @@ function canonicaliseMetadata (meta) {
   return meta
 }
 
-function getFileMetadata (filename) {
+function get (filename) {
   return canonicaliseMetadata(matter.read(filename, options))
 }
 
-function getFolderMetadata (folder) {
-  return fs
-    .readdirSync(folder)
-    .map(f => path.resolve(folder, f))
-    .map(getFileMetadata)
+function getFolder (folder) {
+  return fs.readdirSync(folder).map(f => path.resolve(folder, f)).map(get)
 }
 
 module.exports = {
-  getFileMetadata,
-  getFolderMetadata
+  get,
+  getFolder
 }