PhoenixKitEcommerce.Web.SEOHelpers (PhoenixKitEcommerce v0.2.0)

Copy Markdown View Source

Catalog SEO assigns (canonical / hreflang / og) for the public shop LiveViews, multi-domain aware.

The canonical host per language comes from the workspace-wide config :phoenix_kit, :canonical_host_resolver, {mod, fun} MFA (nil or absent ⇒ the site-wide PhoenixKit.Utils.Routes.url/1 base, today's behavior). On a language's home host its own locale prefix is stripped — the language is that domain's default.

hreflang inclusion for slug-translated pages is decided on the RAW slug map (Map.has_key?(entity.slug, lang)) — SlugResolver silently falls back to the default-language slug, which must never produce an hreflang entry mislabelling the fallback URL as a translation.

Summary

Functions

SEO assigns for the catalog root (path-stable across languages).

SEO assigns for a category page.

SEO assigns for a product page.

Functions

catalog_seo(language)

@spec catalog_seo(String.t()) :: map()

SEO assigns for the catalog root (path-stable across languages).

category_seo(category, language)

@spec category_seo(
  struct(),
  String.t()
) :: map()

SEO assigns for a category page.

product_seo(product, language)

@spec product_seo(
  struct(),
  String.t()
) :: map()

SEO assigns for a product page.