SEO

Default SEO Configuration

The default SEO configuration is already done, but you'll have to adapt for your app.

  1. Open config/site.ts and change the config for your app
export const siteConfig = {
    name: "My Website",
    url: "https://mywebsite.com",
    ogImage: "https://mywebsite.com/og.jpg",
    description: "My Website description",
    links: {
        twitter: "https://twitter.com/dorian_baffier",
    },
    keywords: ["My Website", "My Website description"],
};
 
export type SiteConfig = typeof siteConfig;
 
export const META_THEME_COLORS = {
    light: "#fafafa",
    dark: "#09090b",
};
  1. Open app/sitemap.ts and configure all pages that are available within your website for Google and others. It is pre-configured with the common pages.
import type { MetadataRoute } from "next";
 
export default function sitemap(): MetadataRoute.Sitemap {
    const currentDate = new Date();
 
    return [
        {
            url: "https://mywebsite.com",
            lastModified: currentDate,
            changeFrequency: "monthly",
            priority: 1,
        },
        {
            url: "https://mywebsite.com/sign-in",
            lastModified: currentDate,
            changeFrequency: "monthly",
            priority: 0.5,
        },
        {
            url: "https://mywebsite.com/signup",
            lastModified: currentDate,
            changeFrequency: "monthly",
            priority: 0.5,
        },
        {
            url: "https://mywebsite.com/tos",
            lastModified: currentDate,
            changeFrequency: "monthly",
            priority: 0.5,
        },
        {
            url: "https://mywebsite.com/privacy-policy",
            lastModified: currentDate,
            changeFrequency: "monthly",
            priority: 0.5,
        },
    ];
}
  1. Open app/robots.txt and change the sitemap url
User-Agent: *
Allow: /

Sitemap: https://mywebsite.com/sitemap.xml