 defmodule Serum.Build.Pass3 do
-  alias Serum.FileOutput
   alias Serum.Fragment
   alias Serum.Renderer
   alias Serum.Result

    case Renderer.render_fragment(template, bindings) do
      {:ok, html} ->
        {:ok,
         %FileOutput{
           src: fragment.file,
           dest: fragment.output,
           data: html
         }}

      {:error, _} = error ->

    |> case do
      {:ok, outputs} ->
        create_dirs(outputs)
        Enum.each(outputs, &Serum.File.write/1)

      {:error, _} = error ->
        error
    end
  end

  @spec render(Fragment.t(), Template.t()) :: Result.t(Serum.File.t())
  defp render(fragment, template) do
    bindings = [
      page: fragment.metadata,
