Skua.Components.Meta (Skua v0.12.0)

Copy Markdown View Source

SEO <meta> tags for the document <head> — description, Open Graph, and Twitter cards, plus an optional robots directive and a canonical link.

Render it once in your root layout's <head> (e.g. right after <.live_title>) and drive it from per-page assigns:

<Skua.Components.Meta.seo_meta
  description={assigns[:page_description]}
  title={assigns[:page_title]}
  image={assigns[:page_image]}
  url={assigns[:page_canonical]}
  robots={assigns[:page_robots]}
/>

Every tag is omitted when its value is nil, so a page opts in by assigning page_description (and friends) in mount/3. Public pages set rich meta; scoped/authenticated pages assign nothing — or set page_robots: "noindex, nofollow" to keep themselves out of search results. mix skua.gen.pages wires this into the root layout and sets sensible defaults on the public homepage (and noindex on the authenticated dashboard).

Summary

Functions

Render SEO / Open Graph / Twitter meta from optional per-page assigns.

Functions

seo_meta(assigns)

Render SEO / Open Graph / Twitter meta from optional per-page assigns.

Attributes

  • description (:string) - Defaults to nil.
  • title (:string) - used for og:title / twitter:title. Defaults to nil.
  • site_name (:string) - og:site_name — your app/brand name. Defaults to nil.
  • image (:string) - absolute URL to a share image. Defaults to nil.
  • image_alt (:string) - alt text for the share image. Defaults to nil.
  • url (:string) - canonical URL. Defaults to nil.
  • type (:string) - og:type. Defaults to "website".
  • locale (:string) - og:locale, e.g. "en_US". Defaults to nil.
  • robots (:string) - e.g. "noindex, nofollow". Defaults to nil.