Archivist v0.2.7 Archivist.Archive View Source

Module that coordinates the structured parsing and return of assets in the articles root directory.

Precompiles and provides interface to interact with your articles.

By most Elixir and Erlang conventions this module should be called 'Archivist.Repo' since it's being used for data access, but this library is called Archivist so we're calling it an Archive. Deal with it.

defmodule MyApp.Archive do use Archivist.Archive,

root: "some/other/dir",
body_parser: Earmark

end

alias MyApp.Archive

{:ok, articles} = Archive.all() {:ok, authors} = Archive.authors() {:ok, image_paths} = Archive.image_paths() {:ok, tags} = Archive.tags() {:ok, topics} = Archive.topics() {:ok, titles} = Archive.titles() {:ok, slugs} = Archive.slugs()

{:ok, created_asc} = Archive.sort_by :created_at, :asc {:ok, published_desc} = Archive.sort_by :published_at, :desc {:ok, article} = Archive.fetch_by :slug, "some-article"