contentful-metalsmith
Advanced tools
Comparing version 0.0.0 to 0.1.0
@@ -18,7 +18,7 @@ 'use strict'; | ||
return function(files, metalsmith, done){ | ||
var keys = Object.keys(files), | ||
doneWithFile = partialDone(keys.length, done); | ||
var keys = Object.keys(files); | ||
each(keys, processFile); | ||
each(keys, processFile, done); | ||
//TODO: switch to bluebird promises | ||
function processFile(file, fileProcessedCallback){ | ||
@@ -28,3 +28,2 @@ var fileMetadata = files[file], client, query; | ||
if (!fileMetadata.contentful) { | ||
doneWithFile(); | ||
fileProcessedCallback(); | ||
@@ -54,3 +53,3 @@ return; | ||
client.entries(query).then(onSuccessfulEntriesFetch(fileMetadata.contentful, doneWithFile), onErroneousEntriesFetch(doneWithFile)); | ||
client.entries(query).then(onSuccessfulEntriesFetch(fileMetadata.contentful, fileProcessedCallback), onErroneousEntriesFetch(fileProcessedCallback)); | ||
@@ -61,3 +60,2 @@ /* | ||
debug('Processed file ' + file ); | ||
fileProcessedCallback(); | ||
} | ||
@@ -90,9 +88,2 @@ | ||
function partialDone(pendingFiles, globalDone){ | ||
return function(){ | ||
pendingFiles -= 1; | ||
if (pendingFiles == 0) globalDone(); | ||
}; | ||
} | ||
function pushEntryToContentType(contentTypes, contentType, entry){ | ||
@@ -105,2 +96,3 @@ contentTypes[contentType].push(entry); | ||
var file, | ||
//TODO: fix the contentType | ||
contentType = options.contentType ? contentType : entry.sys.contentType.sys.id; | ||
@@ -107,0 +99,0 @@ |
{ | ||
"name": "contentful-metalsmith", | ||
"version": "0.0.0", | ||
"version": "0.1.0", | ||
"description": "A Metalsmith's plugin to get content from Contentful", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9376
6
112