[0.2.0] - 2026-06-20
Added
PhoenixPageMeta.PageMeta— a prebuilt, config-driven PageMeta struct. The field set is assembled at compile time from a fixed base plusconfig :phoenix_page_meta, extra_fields: [...](bare atoms and{key, default}pairs may be mixed; later entries override earlier ones). Site-wide values (og_type,site_name,twitter_site,supported_locales) are sourced from config as struct defaults. No per-appdefstruct, nouse.- Config-driven base URL resolution for the prebuilt struct:
:base_url(string,&Mod.url/0, or{m, f, a}),:endpoint(explicit module), or auto-detection of the single runningPhoenix.Endpoint(memoized in:persistent_term).:lang_pathconfig (fun/2or{m, f}) overrides the default locale-prefix swap. config :phoenix_page_meta, extra_enforce_keys: [...]to make extra fields required alongside:title/:path.
Changed
use PhoenixPageMeta(with a hand-rolleddefstruct) is deprecated in favour ofPhoenixPageMeta.PageMeta. It still works and emits a compile-time deprecation warning; it will be removed in a future release. The wiring it injects is now shared via the internalPhoenixPageMeta.__setup__/1macro.
[0.1.3] - 2026-06-12
Changed
- Repository moved to https://github.com/saschabrink/phoenix_page_meta — package metadata, docs links, and license now reflect the maintainer's real name.
- CI tests against Elixir 1.19 and 1.20 via the Nix flake dev shells.
- README badges for Hex version, docs, CI status, and license.
Fixed
- The
precommitalias misspelled--warnings-as-errors, so compiler warnings were never treated as errors locally.
[0.1.2] - 2026-05-13
Added
mix phoenix_page_meta.installnow also addsalias <AppWeb>.PageMetainsidedefp html_helpersin the web module, so templates and LiveViews can reference%PageMeta{}directly without the prefix. Idempotent; warns (does not error) ifdefp html_helperscannot be found.
[0.1.1] - 2026-05-13
Added
mix phoenix_page_meta.install— Igniter-powered installer that sets up the PageMeta struct, root.html.heex meta tags, and LiveView callback wiring in one step. Run viamix igniter.install phoenix_page_metaor directly withmix phoenix_page_meta.install.
[0.1.0] - 2026-04-27
Added
use PhoenixPageMetamacro — single line of setup inMyAppWeb.PageMeta. Injects@behaviour PhoenixPageMeta.Site,breadcrumbs/1andactive?/2,3wrappers (pattern-matched to the project struct), defaultbase_url/0andlang_path/2(bothdefoverridable), and@after_compilefield validation.PhoenixPageMeta.Breadcrumb— struct (:title,:path,:first?,:last?,:page_meta) +build/1(walks:parentchain, filters:skip_breadcrumb).PhoenixPageMeta.Components.Breadcrumbs.list/1— slot-based HEEx component owning<nav aria-label>,aria-current="page", and divider placement. Accepts:restglobals (e.g.class).PhoenixPageMeta.Components.MetaTags.default/1— HEEx component rendering description, Open Graph (og:type,og:url,og:title,og:description,og:image,og:image:alt,og:site_name,og:locale,og:locale:alternate), Twitter Card (twitter:card,twitter:title,twitter:description,twitter:image,twitter:site), JSON-LD, canonical, and hreflang alternate tags. Reads optional fields withMap.get/2.- URL fields (
og_image,canonical_path) auto-prefixed withbase_urlwhen relative. Absolute URLs (http:///https://) rendered as-is. - New struct fields recognised by
MetaTags::site_name(rendersog:site_name),:twitter_site(renderstwitter:site),:og_image_alt(rendersog:image:alt, falls back to:title),:locale(rendersog:localeand derivesog:locale:alternatefrom the rest of:supported_locales). PhoenixPageMeta.active?/2,3— link path matching against the current page (exact:andquery:opts), with slash-boundary prefix matching.PhoenixPageMeta.Site— behaviour for site-wide callbacks (base_url/0,lang_path/2).PhoenixPageMeta.LiveView— behaviour for the per-LiveViewpage_meta/2callback, plusassign_page_meta/1helper.- Components dispatch site-wide callbacks via
page_meta.__struct__— no global config. :base_urloption onuseaccepts a string or a 0-arity function capture. When omitted, the macro guessesMyAppWeb.Endpoint.url()from the namespace.:lang_path/2default does locale-prefix swap; override for non-prefix locale schemes.