 template = require 'gulp-template'
 
 gulp.task 'changelog', ->
-	config =
+	options =
 		repository: pkg.repository.url
 		version: pkg.version
 
-	changelog config, (err, log) ->
+	changelog options, (err, log) ->
 		fs.writeFile './CHANGELOG.md', log
 
 
 gulp.task 'default', ['scripts', 'styles', 'views'], ->
-	gulp.src('./.temp/**')
-		.pipe(gulp.dest('./dist/'))
+	gulp
+		.src './.temp/**'
+		.pipe gulp.dest './dist/'
 
 gulp.task 'clean', ->
-	gulp.src(['./bower_components/', './components/', './.temp/', './dist/'])
-		.pipe(clean())
+	gulp
+		.src ['./bower_components/', './components/', './.temp/', './dist/']
+		.pipe clean()
 
 gulp.task 'bower', ['clean'], ->
 	trim = (file, prefix) ->

		scripts: '<script data-main="/scripts/main.js" src="/scripts/libs/require.js"></script>'
		styles: '<!--[if lte IE 8]> <script src="/scripts/libs/json3.js"></script> <script src="/scripts/libs/html5shiv-printshiv.js"></script> <![endif]--><link rel="stylesheet" href="/styles/styles.css" />'

	gulp.src('./.temp/**/*.{html,jade,md,markdown}')
		.pipe(template(data))
		.pipe(gulp.dest('./.temp/'))

gulp.task 'jade', ['template'], ->
	gulp.src('./.temp/**/*.jade')
		.pipe(jade(pretty: true))
		.pipe(gulp.dest('./.temp/'))

gulp.task 'markdown', ['template'], ->
	gulp.src('./.temp/**/*.{md,markdown}')
		.pipe(markdown())
		.pipe(gulp.dest('./.temp/'))

gulp.task 'views', ['jade', 'markdown']


	options =
		quotes: true

	gulp
		.src './.temp/**/*.html'
		.pipe minifyHtml options
		.pipe gulp.dest './.temp/'