thesis v0.0.8 Thesis.Store behaviour
Thesis.Store is an Elixir “behaviour” that defines the public function interface necessary for Thesis to use a particular store module.
There are currently five required functions, as described below.
Summary
Callbacks
Returns a Thesis.Page struct with the given slug (aka request_path)
Returns a map consisting of string keys and Thesis.PageContent structs for the given Thesis.Page struct. This is generally used to populate the page content using the Thesis.View.content/4 function
Returns all pages currently in the database, as a list of Thesis.Page structs. Will return an empty list if none are found
Updates the given page (identified by its slug) with the given map of
string keys and Thesis.PageContent structs. Returns :ok
Callbacks
Specs
page(String.t) :: Thesis.Page.t
Returns a Thesis.Page struct with the given slug (aka request_path).
Specs
page_contents(Thesis.Page.t) :: %{String.t => Thesis.PageContent.t}
Returns a map consisting of string keys and Thesis.PageContent structs for the given Thesis.Page struct. This is generally used to populate the page content using the Thesis.View.content/4 function.
Specs
pages :: %{String.t => Thesis.Page.t}
Returns all pages currently in the database, as a list of Thesis.Page structs. Will return an empty list if none are found.