       if titleKey is 'diary' then null else dir + '/diary/index.html'
       dir + '/index.html'
     ].filter (i) -> i
-  .concat [
-    paths: ['index.html']
-    entry: null
-  ]
 
 ignoreError = (stream) ->
   stream.on 'error', (e) ->

watch = require 'gulp-watch'
prerender = require './prerender'

loadEntries = (src) ->
  myjekyll = require 'myjekyll'
  moment = require 'moment'
  marked = require 'marked'


gulp.task 'build-html', ->
  baseDir = './dist/'
  loadEntriesV3('./data/**/*.md').forEach ({ paths, entry }) ->
    paths.forEach (path) ->
      prerender(baseDir + path, entry)
  prerender(baseDir + 'index.html', null)

gulp.task 'build-html-dev', ->
  baseDir = './dist/'
  loadEntriesV3('./data/nofile.md').forEach ({ paths, entry }) ->
    paths.forEach (path) ->
      prerender(baseDir + path, entry)
  prerender(baseDir + 'index.html', null)

gulp.task 'build-images', ->
  gulp.src './src/images/*'
