BlogEngine.Public (blog_engine v0.1.0)

Copy Markdown View Source

Transport-neutral public read models for effective blog content.

Summary

Functions

Gets an active author visible through the selected blog.

Gets a post by its canonical slug on its source blog; syndicated target placement is not a route.

Lists active authors with effective public posts on a blog.

Lists one page of effective public posts for a source or syndication target blog.

Lists effective public tags and their post counts for a blog.

Functions

get_active_author_by_slug(context, blog_id, slug)

@spec get_active_author_by_slug(BlogEngine.Context.t(), Ecto.UUID.t(), String.t()) ::
  {:ok, BlogEngine.Schema.Author.t()} | {:error, BlogEngine.Error.t()}

Gets an active author visible through the selected blog.

get_post_by_slug(context, blog_id, slug)

@spec get_post_by_slug(BlogEngine.Context.t(), Ecto.UUID.t(), String.t()) ::
  {:ok, BlogEngine.Public.Entry.t()} | {:error, BlogEngine.Error.t()}

Gets a post by its canonical slug on its source blog; syndicated target placement is not a route.

list_active_authors(context, blog_id)

@spec list_active_authors(BlogEngine.Context.t(), Ecto.UUID.t()) ::
  {:ok, [%{author: BlogEngine.Schema.Author.t(), count: non_neg_integer()}]}
  | {:error, BlogEngine.Error.t()}

Lists active authors with effective public posts on a blog.

list_feed(context, blog_id, opts \\ [])

Lists one page of effective public posts for a source or syndication target blog.

list_tags_with_counts(context, blog_id)

@spec list_tags_with_counts(BlogEngine.Context.t(), Ecto.UUID.t()) ::
  {:ok, [%{tag: BlogEngine.Schema.Tag.t(), count: non_neg_integer()}]}
  | {:error, BlogEngine.Error.t()}

Lists effective public tags and their post counts for a blog.