View Source PlausibleWeb.StatsView (Plausible v0.0.1)
Summary
Functions
The resource name, as an atom, for this view
Returns a readable stats URL.
Renders the given template locally.
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.
Functions
The resource name, as an atom, for this view
Returns a readable stats URL.
Native Phoenix router functions percent-encode all diacritics, resulting in
ugly URLs, e.g. https://plausible.io/café.com
transforms into
https://plausible.io/caf%C3%A9.com
.
This function encodes only the slash (/
) character from the site's domain.
Examples
iex> PlausibleWeb.StatsView.pretty_stats_url(%Plausible.Site{domain: "user.gittea.io/repo"}) "http://localhost:8000/user.gittea.io%2Frepo"
iex> PlausibleWeb.StatsView.pretty_stats_url(%Plausible.Site{domain: "anakin.test"}) "http://localhost:8000/anakin.test"
iex> PlausibleWeb.StatsView.pretty_stats_url(%Plausible.Site{domain: "café.test"}) "http://localhost:8000/café.test"
Renders the given template locally.
Callback invoked when no template is found. By default it raises but can be customized to render a particular template.