Skip to main content

@latimer-woods-tech/seo

Server-side SEO tag generation for Cloudflare Workers. No dependencies.

Installation

API

generateMetaTags(opts)

Returns an HTML string of <meta> tags for a page.
Includes:
  • Standard <title> and <meta name="description">
  • OpenGraph (og:title, og:description, og:image, og:url, og:type)
  • Twitter Card (twitter:card, twitter:title, twitter:description, twitter:image)
  • Canonical <link rel="canonical">

generateJsonLd(schema)

Serializes a JSON-LD schema object into a <script type="application/ld+json"> tag.

generateSitemap(pages)

Generates an XML sitemap string.

generateRobotsTxt(opts)

Generates a robots.txt content string.

Example