     {:ok, articles, failed_paths}
   end
 
-  defp download_article(author, family, path, sha) do
+  defp download_article(author, family, path) do
     client = Tentacat.Client.new(%{access_token: Author.token_github(author)})
     content = Tentacat.Contents.find(author.name, family.name, path, client)
     if is_valid_content(content) do


  defp parse_title(body, path) do
    default = "Title"
    pattern = title_pattern(path)
    if pattern do
      captured = Regex.named_captures(pattern, body, capture: :first)
      if captured, do: captured["title"], else: default


  def import(conn, %{"family" => family_params}) do
    author = Session.current_author(conn)
    result = with {:ok, _} <- Git.clone([family_params["source"], family_params["path"]]),
    repository = Repository.changeset(%Repository{}, family_params),
    {:ok, repository} <- Repo.insert(repository),
    family = Family.changeset(%Family{repository_id: repository.id, author_id: author.id}, family_params),
    {:ok, family} <- Repo.insert(family),
    do: {:ok, family}

  case result do
    {:ok, family} ->
      conn
      |> put_flash(:info, "Repository imported successfully.")
      |> render(conn, :import, family: family)
    {:error, _} ->
      conn
      |> put_flash(:info, "Failed to import repository.")
      |> redirect(to: github_path(conn, :index))
  end
  end

  def sync(conn, %{"family" => family_params}) do
