SEO in Astro v1.0.0-beta.0 is here

In this release, the main focus was on turning SEO in Astro into a formal library with utilities to generate robots.txt files, sitemap.xml and llms.txt.

I decided to launch it in beta to receive feedback from the community and improve the project before the official 1.0 version.

These are the most important changes.

Formal library

SEO in Astro used to be a collection of components and utilities. Now it's a formal library to handle SEO in your Astro applications.

Centralized configuration

New integration for Astro where you define everything in one place: URL, site name, and more.

import { defineConfig } from "astro/config"
import { seoInAstro } from "@dlcastillop/seo-in-astro";

 export default defineConfig({
   integrations: [
     seoInAstro({
       baseUrl: "https://example.com",
       siteName: "Example",
       defaultOgImg: "/default-og.png",
     }),
   ],
 });

Automatic generation

Automatic generation of robots.txt, sitemap.xml, and llms.txt files. Fully customizable.

import { defineConfig } from "astro/config";
import { seoInAstro } from "@dlcastillop/seo-in-astro";

export default defineConfig({
  integrations: [
    seoInAstro({
      baseUrl: "https://example.com",
      siteName: "Example",
      defaultOgImg: "/default-og.png",
      robotsTxt: {
        rules: [
          {
            userAgent: "*",
            allow: "/",
            disallow: ["/admin", "/private"],
          },
          {
            userAgent: "Googlebot",
            allow: "/",
            crawlDelay: 10,
          },
        ],
      },
    }),
  ],
});
import { defineConfig } from "astro/config";
import { seoInAstro } from "@dlcastillop/seo-in-astro";

export default defineConfig({
  integrations: [
    seoInAstro({
      baseUrl: "https://example.com",
      siteName: "Example",
      defaultOgImg: "/default-og.png",
      sitemapXml: {
        sitemap: [
          {
            route: "/",
            lastModified: new Date(),
            changeFrequency: "daily",
            priority: 1,
          },
          {
            route: "/about",
            lastModified: new Date("2024-01-15"),
            changeFrequency: "monthly",
            priority: 0.8,
          },
        ],
      },
    }),
  ],
});
import { defineConfig } from "astro/config";
import { seoInAstro } from "@dlcastillop/seo-in-astro";

export default defineConfig({
  integrations: [
    seoInAstro({
      baseUrl: "https://example.com",
      siteName: "Example",
      defaultOgImg: "/default-og.png",
      llmsTxt: true,
    }),
  ],
});

Try it out and let me know what you think!

Get it now | Read the docs