@novahelm/seo
v2026.6.1
Published
NovaHelm SEO — metadata, JSON-LD, Open Graph, and sitemaps.
Maintainers
Readme
@novahelm/seo
SEO toolkit for NovaHelm — Next.js metadata generation, JSON-LD structured data, Open Graph images, sitemaps, robots.txt, RSS feeds, hreflang, and validation.
Quick Start
pnpm add @novahelm/seoimport { createMetadata } from "@novahelm/seo";
// In a Next.js page
export const metadata = createMetadata({
title: "My Page",
description: "Page description for search engines",
url: "https://example.com/page",
image: "https://example.com/og.png",
});JSON-LD Structured Data
Render JSON-LD in your pages for rich search results:
import { JsonLd, articleJsonLd, organizationJsonLd } from "@novahelm/seo";
export default function BlogPost({ post }) {
return (
<>
<JsonLd data={articleJsonLd({
title: post.title,
author: post.author,
datePublished: post.publishedAt,
image: post.coverImage,
})} />
<article>{post.content}</article>
</>
);
}Available generators: organizationJsonLd, articleJsonLd, productJsonLd, faqJsonLd, breadcrumbJsonLd, eventJsonLd, personJsonLd, webPageJsonLd.
Sitemap and Robots
import { buildSitemap, generateRobots } from "@novahelm/seo";
// Generate sitemap XML
const xml = buildSitemap([
{ url: "https://example.com/", changefreq: "daily", priority: 1.0 },
{ url: "https://example.com/blog", changefreq: "weekly", priority: 0.8 },
]);
// Generate robots.txt
const robots = generateRobots({
sitemapUrl: "https://example.com/sitemap.xml",
disallow: ["/admin", "/api"],
});RSS Feed
import { buildRSSFeed } from "@novahelm/seo";
const rss = buildRSSFeed({
title: "My Blog",
link: "https://example.com",
description: "Latest posts",
items: posts.map((p) => ({
title: p.title,
link: `https://example.com/blog/${p.slug}`,
pubDate: p.publishedAt,
description: p.excerpt,
})),
});Hreflang (i18n)
Generate alternate language links for multilingual sites:
import { generateHreflang, hreflangToMetadata } from "@novahelm/seo";
const links = generateHreflang({
baseUrl: "https://example.com",
path: "/about",
locales: [
{ lang: "en", region: "US" },
{ lang: "es", region: "ES" },
],
});
// Convert to Next.js metadata format
export const metadata = { alternates: hreflangToMetadata(links) };OG Image
Build dynamic Open Graph image URLs and handler factories:
import { buildOgImageUrl, createOgImageHandler } from "@novahelm/seo";
const url = buildOgImageUrl({
baseUrl: "https://example.com",
title: "My Post Title",
subtitle: "By Author Name",
});
// Create a Next.js route handler for OG image generation
export const GET = createOgImageHandler({ width: 1200, height: 630 });API Reference
| Export | Description |
|--------|-------------|
| createMetadata(opts) | Generate Next.js Metadata object |
| JsonLd | React component to render JSON-LD <script> tags |
| generateRobots(opts) | Generate robots.txt content |
| buildSitemap(entries) | Generate sitemap XML |
| buildRSSFeed(channel) | Generate RSS 2.0 XML feed |
| organizationJsonLd(data) | Organization structured data |
| articleJsonLd(data) | Article structured data |
| productJsonLd(data) | Product structured data |
| faqJsonLd(data) | FAQ structured data |
| breadcrumbJsonLd(data) | Breadcrumb structured data |
| eventJsonLd(data) | Event structured data |
| personJsonLd(data) | Person structured data |
| webPageJsonLd(data) | WebPage structured data |
| generateHreflang(config) | Generate hreflang alternate links |
| hreflangToMetadata(links) | Convert hreflang to Next.js metadata |
| buildOgImageUrl(config) | Build dynamic OG image URL |
| createOgImageHandler(config) | Create OG image route handler |
| validateJsonLd(data) | Validate JSON-LD structure |
