View Source Blog (Postex v0.1.9)

For testing only

Summary

Functions

Gets a specific post by the id (slug)

Returns a list of all the posts

Returns a list of posts for the page, accepts page as integer or string

Gets a list of all the tags

Number of pages of posts

Returns a list of all the posts with a tag

Returns a map with the tags as keys and the frequency as a value

Functions

fetch_post(id)

@spec fetch_post(binary()) :: {:ok, Postex.Post.t()} | {:error, :not_found}

get_post(id)

@spec get_post(binary()) :: Postex.Post.t() | nil

Gets a specific post by the id (slug)

list_posts()

@spec list_posts() :: [Postex.Post.t()]

Returns a list of all the posts

list_posts(page)

@spec list_posts(pos_integer() | String.t()) :: [Postex.Post.t()]

Returns a list of posts for the page, accepts page as integer or string

list_tags()

@spec list_tags() :: [binary()]

Gets a list of all the tags

pages()

@spec pages() :: non_neg_integer()

Number of pages of posts

posts_tagged_with(tag)

@spec posts_tagged_with(binary()) :: [Postex.Post.t()]

Returns a list of all the posts with a tag

tags_with_count()

@spec tags_with_count() :: %{required(String.t()) => pos_integer()}

Returns a map with the tags as keys and the frequency as a value