Phoenix Live Head

Provides commands for manipulating the HTML Head of Phoenix Live View applications while minimizing data over the wire.

The available command actions support a variety of utility operations useful for HTML Head manipulation. Such as setting or removing tag attributes and adding or removing CSS classes.

Note

When using this lib directly, consider publishing a high-level lib like Phx.Live.Favicon. High-level libs provide a cleaner syntax and specific documentation for their intended usage.

documentation

Documentation

Documentation can be found at HexDocs.

support-feature-requests-and-contributing

Support, Feature Requests and Contributing

See CONTRIBUTING

installation

Installation

The package can be installed by adding phoenix_live_head to your list of dependencies in mix.exs:

def deps do
  [
    {:phoenix_live_head, "~> 0.1.2"}
  ]
end

To include the necessary client side Javascript, import the module in assets/js/app.js

import "phoenix_html"
// Establish Phoenix Socket and LiveView configuration.
import { Socket } from "phoenix"
import { LiveSocket } from "../vendor/phoenix_live_view/"
import topbar from "../vendor/topbar"
import "phoenix_live_head" // <-- ADD HERE.

development

Development

  • Assets can be build using mix assets.build
  • Override :phoenix_live_head in your test application with a local path:
    # example
    def deps do
      [
        {:phoenix_live_head, path: "../phoenix_live_head", override: true}
      ]
    end