DefaultTitle
Creates automatic placeholder titles for a Phoenix app layout.
Installation
If available in Hex, the package can be installed as:
-
Add
default_titleto your list of dependencies inmix.exs:
```elixir
def deps do
[
{:default_title, "~> 0.0.1", hex: :phoenix_default_title},
]
end
```Usage
Open your Phoenix application’s layout file and add the call to the title tag:
<title><%= assigns[:page_title] || DefaultTitle.default_title(@conn) %></title>The following options are available as a keyword list in the second argument:
separator:
* String used to separate the page and app titles
* Defaults to `|`suffix:- Application name shown after the page title
- Automatically inferred from the endpoint name by default
-
Set to
:noneto disable