Tayori.Router.Page (Tayori v0.1.0)

Copy Markdown View Source

The public page of the news, each entry's page, and the feeds, mounted with tayori_page/2 (imported with Tayori.Router). See Tayori.Page for the routes, and The public page guide.

Summary

Functions

Mounts Tayori.Router.Page at path in a host router.

Functions

tayori_page(path, opts \\ [])

(macro)

Mounts Tayori.Router.Page at path in a host router.

import Tayori.Router.Page

scope "/" do
  pipe_through :browser
  tayori_page "/tayori"
end

Options

  • :title - The title of the page and the feeds ("What's new", in the reader's language). A string, or a map of a locale to a string for each language (%{"en" => "Changelog", "pt-PT" => "Novidades"}).

  • :description - A line under the title, and the description of the page for search engines and shared links. A string, or a map by locale.

  • :eyebrow - A short line above the title: the app's name, say. A string, or a map by locale.

  • :image (String.t/0) - The picture of a shared link to the page (an absolute URL), and of an entry with none of its own.

  • :resolver (atom/0) - The app's Tayori.Resolver: a reader it gives sees the entries for them too. Without it, the page shows the entries for everyone.

  • :layout (tuple of atom/0, atom/0 values) - The app's root layout, {module, function}, instead of Tayori's own document. It gets @inner_content, @conn, @page_title, @locale, @description, @canonical, @feed, @meta and @head (see Tayori.Page.head/1).

  • :theme - The theme of Tayori's own document. The default value is :tayori.

  • :limit (pos_integer/0) - The entries of a page. The default value is 20.

  • :url (String.t/0) - The app's address ("https://example.com"), for the links of the feeds, when the conn does not have it (behind a proxy).

Every mount also takes the options listed in PhoenixMountable, such as :as, :on_mount and :csp_nonce_assign_key.