serum v0.13.0 Serum.PostList

Defines a struct representing a list of blog posts.

Fields

  • tag: Specifies by which tag the posts are filtered. Can be nil
  • current_page: Number of current page
  • max_page: Number of the last page
  • title: Title of the list
  • posts: A list of Post structs
  • url: Absolute URL of this list page in the website
  • prev_url: Absolute URL of the previous list page. Can be nil if this is the first page
  • next_url: Absolute URL of the next list page. Can be nil if this is the last page
  • output: Destination path

Link to this section Summary

Link to this section Types

Link to this type

maybe_tag()
maybe_tag() :: Serum.Tag.t() | nil

Link to this type

t()
t() :: %Serum.PostList{
  current_page: pos_integer(),
  max_page: pos_integer(),
  next_url: binary() | nil,
  output: binary(),
  posts: [map()],
  prev_url: binary() | nil,
  tag: maybe_tag(),
  title: binary(),
  url: binary()
}

Link to this section Functions

Link to this function

compact(list)
compact(t()) :: map()

Link to this function

generate(tag, posts, proj)
generate(maybe_tag(), [map()], map()) :: Serum.Result.t([t()])

Link to this function

to_fragment(post_list, _)
to_fragment(t(), any()) :: Serum.Result.t(Serum.Fragment.t())