PhoenixSEOTools.Components.Head (phoenix_seo_tools v0.0.2)
View SourcePhoenix 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
Renders SEO-related meta tags, JSON-LD structured data, and link tags.
Attributes
page_title- The title of the page (optional, will usemeta.page_titleif not provided)meta- A map containing SEO metadata, typically coming fromPhoenixSEOTools.SEO.build_meta/2:page_title- The title of the page:metas- A list ofPhoenixSEOTools.PageMetastructs:schemas- A list of JSON-LD structured data maps:links- A list ofPhoenixSEOTools.PageLinkstructs
Examples
<.meta meta={@meta} page_title={@page_title} />Attributes
page_title(:string)meta(:map) - Defaults to%{}.