PhoenixSEOTools.Components.Head (phoenix_seo_tools v0.0.2)

View Source

Phoenix component for rendering SEO-related elements in the HTML head.

This component renders meta tags, JSON-LD structured data, and link tags that have been generated by the PhoenixSEOTools.SEO module.

Usage

Add this component to your root layout:

<head>
  <meta charset="utf-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1" />
  <.meta meta={@meta} page_title={@page_title} />
  <!-- other head elements -->
</head>

The meta assign is expected to come from the PhoenixSEOTools.SEO.build_meta/2 function.

Summary

Functions

Renders SEO-related meta tags, JSON-LD structured data, and link tags.

Functions

meta(assigns)

Renders SEO-related meta tags, JSON-LD structured data, and link tags.

Attributes

Examples

<.meta meta={@meta} page_title={@page_title} />

Attributes

  • page_title (:string)
  • meta (:map) - Defaults to %{}.