         Enum.each mkdir_result, fn {dirname, _} ->
           IO.puts "Created directory `#{dirname}`."
         end
-        :ok
       [{dirname, {:error, reason}}|_] ->
         {:error, {reason, dirname, 0}}
     end

    mkdir_result =
      dirs
      |> Enum.map(fn x ->
        dirname = dir <> x
        {dirname, File.mkdir_p(dirname)}
      end)
    case Enum.reject(mkdir_result, fn {_, x} -> x == :ok end) do

        date_format: "{WDfull}, {D} {Mshort} {YYYY}",
        preview_length: 200}
      |> Poison.encode!(pretty: true, indent: 2)
    fname = Path.join dir, "serum.json"
    fwrite fname, projinfo
    IO.puts "Generated `#{fname}`."
  end

  # Generates a minimal index page for the new project.
  @spec create_index(binary) :: :ok

  defp create_index(dir) do
    fname = Path.join dir, "pages/index.md"
    fwrite fname, """
    ---
    title: Welcome
    ---

    *Hello, world!*
    """
    IO.puts "Generated `#{fname}`."
  end

  # Generates default template files.
