Serum.PostList (serum v1.5.1) View Source

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

Specs

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

Specs

t() :: %Serum.PostList{
  current_page: pos_integer(),
  extras: %{optional(binary()) => binary()},
  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

Specs

compact(t()) :: map()
Link to this function

generate(tag, posts, proj)

View Source

Specs

generate(maybe_tag(), [map()], Serum.Project.t()) :: Serum.Result.t([t()])

Specs

to_fragment(t()) :: Serum.Result.t(Serum.Fragment.t())