thesis v0.3.4 Thesis.Page

Represents a page (dynamic or static), and also contains meta data like title, description, and redirect if necessary.

Link to this section Summary

Functions

Changeset for Page structs

Returns whether the page redirects to another page

Link to this section Types

Link to this type

t()
t() :: %Thesis.Page{
  __meta__: term(),
  description: String.t() | nil,
  id: any(),
  inserted_at: any(),
  redirect_url: String.t() | nil,
  slug: String.t(),
  template: String.t() | nil,
  title: String.t() | nil,
  updated_at: any()
}

Link to this section Functions

Link to this function

changeset(page, params \\ %{})

Changeset for Page structs.

Link to this function

redirected?(arg1)

Returns whether the page redirects to another page.

Examples:

iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: nil})
false
iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: ""})
false
iex> Thesis.Page.redirected?(%Thesis.Page{slug: "", redirect_url: "/asdf"})
true