Skip to content

Enrich listing detail pages with product-type OpenGraph tags

jedmund requested to merge jedmund/product-og-tags into main

Summary

  • Extend SiteHead with type, imageAlt, priceAmount, priceCurrency, availability, and condition props.
  • Detail pages now render og:type=product plus product:price:amount, product:price:currency, product:availability (mapped from listing status: for_sale → "in stock", pending → "pending", sold → "out of stock"), and product:condition (new → "new"; like_new/good/junk → "used").
  • Add og:image:alt / twitter:image:alt using the listing title whenever there's a cover image.
  • Non-listing pages keep og:type=website.

Test plan

  • curl https://yardsale.atelier.house/sale/<short_id> and grep for property="og: and property="product: — confirm product tags are present with the listing's price
  • Mark a listing sold → confirm product:availability="out of stock"; mark pending → "pending"
  • Set condition=new → product:condition="new"; set condition=like_new → "used"
  • Paste a listing URL into a link preview tool (e.g. opengraph.xyz) and confirm the title, description, and image render

Merge request reports

Loading