Helpers for the host module behind GamendWeb.Plugs.PageMeta.
Every host answers "what is this page about" with its own copy, but the
mechanics around that copy — normalising the path it is keyed by, stripping
markdown out of it, cutting it to what a search engine shows, and turning a
breadcrumb trail into BreadcrumbList markup — are the same everywhere.
Summary
Functions
trail as a schema.org BreadcrumbList, or nil when it has no ancestry.
An absolute URL for path under the locale being rendered.
The lookup form of path: no trailing slash, / for the root.
text as the plain prose a <meta name="description"> takes.
text cut to max characters at a word boundary.
An absolute URL for path.
Functions
trail as a schema.org BreadcrumbList, or nil when it has no ancestry.
Built from the trail the layout renders, so the visible crumbs and the markup cannot disagree. Crumb URLs are locale-prefixed to match the page's canonical — a French page whose trail points at English URLs describes a different page.
An absolute URL for path under the locale being rendered.
The lookup form of path: no trailing slash, / for the root.
text as the plain prose a <meta name="description"> takes.
Descriptions are drawn from markdown — a post's excerpt, a guide's opening paragraph — where links and emphasis would otherwise reach the snippet as their own source characters.
@spec truncate(String.t() | nil, pos_integer()) :: String.t() | nil
text cut to max characters at a word boundary.
Defaults to the ~160 characters Google shows before it truncates.
An absolute URL for path.