Structured content layer for Phoenix apps.
Brix models content as pages composed of sections, each rendered by a named template. Pages live inside layouts that provide shared header/footer sections, and can reference authors, tags, media, and collections.
All functions delegate to the configured store backend:
config :brix, store: Brix.Store.Filesystem
Summary
Functions
Looks up a redirect target for a legacy slug. Returns the new slug or :error.
Fetches an author by slug.
Fetches a collection by slug.
Fetches a layout by name.
Fetches a media asset by slug.
Fetches a page by slug.
Fetches a section template by name.
Fetches a shared section by name.
Returns the site configuration.
Fetches a tag by slug.
Lists all authors.
Lists child collections whose parent matches the given slug.
Lists pages belonging to a collection, applying its filters and sort order.
Lists all collections.
Lists all media assets.
Lists pages.
Lists all section templates.
Lists all shared sections.
Lists all tags.
Reloads all content from the store backend.
Functions
Looks up a redirect target for a legacy slug. Returns the new slug or :error.
@spec get_author(String.t()) :: {:ok, Brix.Author.t()} | :error
Fetches an author by slug.
@spec get_collection(String.t()) :: {:ok, Brix.Collection.t()} | :error
Fetches a collection by slug.
@spec get_layout(String.t()) :: {:ok, Brix.Layout.t()} | :error
Fetches a layout by name.
@spec get_media(String.t()) :: {:ok, Brix.Media.t()} | :error
Fetches a media asset by slug.
@spec get_page( String.t(), keyword() ) :: {:ok, Brix.Page.t()} | :error
Fetches a page by slug.
Options
:status— filter by publish status::published,:draft, or:all(default:published):prefix— match pages whose slug starts with the given prefix
@spec get_section_template(String.t()) :: {:ok, Brix.SectionTemplate.t()} | :error
Fetches a section template by name.
@spec get_site() :: Brix.Site.t()
Returns the site configuration.
@spec get_tag(String.t()) :: {:ok, Brix.Tag.t()} | :error
Fetches a tag by slug.
@spec list_authors() :: [Brix.Author.t()]
Lists all authors.
@spec list_child_collections(String.t()) :: [Brix.Collection.t()]
Lists child collections whose parent matches the given slug.
@spec list_collection_pages( Brix.Collection.t(), keyword() ) :: [Brix.Page.t()]
Lists pages belonging to a collection, applying its filters and sort order.
Options
:status— filter by publish status::published,:draft, or:all(default:published)
@spec list_collections() :: [Brix.Collection.t()]
Lists all collections.
@spec list_media() :: [Brix.Media.t()]
Lists all media assets.
@spec list_pages(keyword()) :: [Brix.Page.t()]
Lists pages.
Options
:status— filter by publish status::published,:draft, or:all(default:published):prefix— match pages whose slug starts with the given prefix
@spec list_section_templates() :: [Brix.SectionTemplate.t()]
Lists all section templates.
@spec list_tags() :: [Brix.Tag.t()]
Lists all tags.
@spec reload() :: :ok | {:error, term()}
Reloads all content from the store backend.