 			database = docpad.getDatabase()
 			docpadConfig = docpad.getConfig()
 
+			# Imported
+			imported = 0
+
 			# Log
 			docpad.log('info', "Importing Tumblr posts...")
 

				# Inject our posts
				eachr tumblrPosts, (tumblrPost,i) ->
					# Prepare
					document = docpad.getFile({tumblrId: tumblrPost.id})

					# Prepare
					documentTime = document?.get('mtime') or null
					tumblrPostTime = new Date(tumblrPost.date)

					# Check
					if documentTime and documentTime.toString() is tumblrPostTime.toString()
						# Log
						docpad.log('debug', "Skipped   tumblr post #{i}/#{tumblrPosts.length}: #{document.getFilePath()}")

						# Skip
						return

					###
					console.log """
					---
					#{config.relativeDirPath}/#{tumblrPost.type}/#{tumblrPost.id}#{config.extension}
					#{documentTime?.toString() or 'no date'}
					#{tumblrPostTime.toString()}
					"""
					###

					# Prepare
					documentAttributes =
						data: JSON.stringify(tumblrPost, null, '\t')
						meta:
							tumblrId: tumblrPost.id
							tumblrType: tumblrPost.type
							tumblr: tumblrPost
							title: (tumblrPost.title or tumblrPost.track_name or tumblrPost.text or tumblrPost.caption or '').replace(/<(?:.|\n)*?>/gm, '')
							date: new Date(tumblrPost.date)
							mtime: tumblrPostTime
							tags: (tumblrPost.tags or []).concat([tumblrPost.type])
							relativePath: "#{config.relativeDirPath}/#{tumblrPost.type}/#{tumblrPost.id}#{config.extension}"



					# Add it to the database
					database.add(document)
					++imported

					# Log
					docpad.log('debug', "Imported  tumblr post #{i}/#{tumblrPosts.length}: #{document.getFilePath()}")

				# Log
				docpad.log('info', "Imported #{imported}/#{tumblrPosts.length} Tumblr posts...")

				# Complete
				return next()
