schema_org - Strictly-typed builder for generating SEO Schema.org JSON-LD

SchemaOrg

A strictly-typed builder for generating SEO Schema.org JSON-LD in Elixir and Phoenix applications.

You should not have to memorise the Schema.org vocabulary. This library ships 1000+ generated struct modules (SchemaOrg.Product, SchemaOrg.Offer, …), one per Schema.org Class. Build a graph with ordinary struct literals — your editor auto-completes the valid fields and the compiler rejects the rest — then serialise it with to_json_ld/1.

%SchemaOrg.Product{
  name: "MacBook Pro",
  offers: %SchemaOrg.Offer{price: 1999.00, price_currency: "USD"}
}
|> SchemaOrg.to_json_ld()
{
  "@context": "https://schema.org",
  "@type": "Product",
  "name": "MacBook Pro",
  "offers": { "@type": "Offer", "price": 1999.0, "priceCurrency": "USD" }
}

hex docs

5 Likes