SEO (Sitemap, robots, JSON-LD)

ShipSaaS is built on the Next.js Metadata API as the single source of truth for <title>, <meta>, Open Graph, and Twitter Card tags. Combined with auto-generated sitemap.xml and robots.txt, every page is indexable from the moment you deploy.

Page metadata

Every route exports a metadata object or a generateMetadata function. Example:

// src/app/blog/[slug]/page.tsx
export async function generateMetadata({ params }) {
  const post = await getPostBySlug(params.slug);
  return {
    title: post.title,
    description: post.excerpt,
    openGraph: {
      title: post.title,
      description: post.excerpt,
      type: "article",
      publishedTime: post.date,
    },
  };
}

Never use <title> or <meta> tags inside a "use client" component — they will be silently dropped. Move the metadata to a server component or to the page that owns the route.

Sitemap

The sitemap lives at src/app/sitemap.ts and is auto-served at /sitemap.xml. It includes the static marketing pages plus every blog post pulled from the filesystem.

// src/app/sitemap.ts
export default async function sitemap() {
  const baseUrl = process.env.NEXT_PUBLIC_SITE_URL;
  const posts = await getAllPosts();
  return [
    { url: baseUrl, lastModified: new Date() },
    ...posts.map(p => ({
      url: `${baseUrl}/blog/${p.slug}`,
      lastModified: new Date(p.date),
    })),
  ];
}

Submit https://yourdomain.com/sitemap.xml in Google Search Console after you deploy.

robots.txt

src/app/robots.ts controls /robots.txt. By default, ShipSaaS disallows /dashboard/, /auth/, and /api/ from crawlers.

Structured data (JSON-LD)

Use the StructuredData component to inject schema.org JSON-LD into any page. The blog detail page ships with BlogPosting markup so Google can render rich results.

import { StructuredData } from "@/components/StructuredData";

<StructuredData data={{
  "@context": "https://schema.org",
  "@type": "BlogPosting",
  headline: post.title,
  datePublished: post.date,
  author: { "@type": "Person", name: post.author },
}} />

Do not add aggregateRating or offers schema unless you have real reviews or a real product to sell. Google penalizes sites that publish fake ratings.

Open Graph images

ShipSaaS expects an og-image.png in the public/ directory (1200×630). Replace the placeholder with your own branded image. The Metadata API will reference it automatically.

Canonical URLs

metadataBase is set in the root layout, so all relative Open Graph and canonical URLs are resolved against NEXT_PUBLIC_SITE_URL. Set that env var in every environment to avoid canonical mismatch warnings in Search Console.