Sets up phoenix_page_meta in the Phoenix project
Performs four steps:
Adds a
config :phoenix_page_metablock toconfig/config.exswith starter values (:site_name,:supported_locales,:extra_fields). The prebuiltPhoenixPageMeta.PageMetastruct is config-driven — there is no per-app PageMeta module to create.Injects
<PhoenixPageMeta.Components.MetaTags.default>intolib/<app_web>/components/layouts/root.html.heex, right before the existing<.live_titleelement.Adds
@behaviour PhoenixPageMeta.LiveViewandimport PhoenixPageMeta.LiveView, only: [assign_page_meta: 1]afteruse Phoenix.LiveViewinside thedef live_viewmacro in the main web module.Adds
alias PhoenixPageMeta.PageMetainside thedefp html_helpersblock in the main web module so that templates and LiveViews can reference%PageMeta{}directly.
All four steps are idempotent — re-running the task is safe.
Example
mix phoenix_page_meta.install