           i = if i > 59, do: 59, else: i
           {h, i}
         end
-      {:ok, {y, m, d, h, i}}
+      {y, m, d, h, i}
     rescue
       _ in MatchError ->
-        {:error, :invalid_filename}
-    end
-  end
-
-  defp extract_title_tags(title, tags, proj) do
+        mkinfo_fail srcdir, filename, :invalid_filename
+    end
+  end
+
+  defp extract_title_tags(srcdir, filename, title, tags, proj) do
     try do
       {"# " <> title, "#" <> tags} = {title, tags}
       title = title |> String.trim

    exit "error while building blog posts"
  end

  defp extract_date(filename) do
    try do
      [y, m, d, hhmm|_] = filename |> String.split("-") |> Enum.map(fn x ->
        case Integer.parse(x) do

    Agent.update Serum.Build.PostInfoStorage, &([info|&1])
  end

  defp make_preview(_html, 0) do
    ""
  end

  defp make_preview(html, maxlen) do
    html
    |> Floki.parse
    |> Enum.filter(&(elem(&1, 0) == "p"))
    |> Enum.map(&(Floki.text elem(&1, 2)))
    |> Enum.join(" ")
    |> String.slice(0, maxlen)
  end

  def tag_task(dest, {k, v}, template) do
    tagdir = "#{dest}tags/#{k.name}/"
    pt = "Posts Tagged \"#{k.name}\""
