Skip to content

Search engines and AI assistants

A site with @seamlet/astro is ready for search right after it is connected. The integration serves three files that Yandex, Google, Bing and AI assistants read — Алиса (Alice, Yandex’s assistant), ChatGPT, Claude, Perplexity. The files are built from the published content: the owner added a product and published — half a minute later its page is in the sitemap.

It needs @seamlet/astro 2.3 or newer.

The sitemap and robots.txt write full addresses of pages, so the integration needs the site’s address — site in the Astro config:

astro.config.mjs
import node from "@astrojs/node";
import seamlet from "@seamlet/astro";
import { defineConfig } from "astro/config";
export default defineConfig({
site: "https://example.ru",
output: "server",
adapter: node({ mode: "standalone" }),
integrations: [seamlet()],
});

Without site the sitemap is not served, and the build warns about it.

Address What is in it
/sitemap.xml The full address of every page the site shows: its own pages and the pages of records. Hidden records (left out by shows) and the preview are not in the sitemap.
/robots.txt The site is open to all crawlers. The crawlers of search engines and AI assistants are named apart: YandexBot, Googlebot, Bingbot, GPTBot, ClaudeBot, PerplexityBot and others. Closed is what only the CMS needs: /preview, /seamlet, /seamlet-photos.
/llms.txt The site for an AI assistant in the llmstxt.org format: the title from seamlet.json, the description of the home page, then the pages and the pages of records — a link, the title and the description for search engines of each.

Titles and descriptions come from the fields the owner edits in the editor: the group of title and description that the searchTexts of a page or a record points at (usually seoFields()). If the owner left the title empty, llms.txt gets the page’s title in the editor or the record’s name.

The files are built on request and keep the published content for half a minute. If the CMS does not answer, the site answers 503 with Retry-After, and the crawler comes back later without losing the previous version.

If the site has its own file — public/robots.txt or a route src/pages/robots.txt.ts — the integration leaves it alone. The same goes for sitemap.xml and llms.txt.

To turn a file off, pass false:

integrations: [seamlet({ sitemap: false, robots: false, llms: false })],

Structured data is schema.org in the JSON-LD format: opening hours, the price of a product and the questions of a page, which a search engine reads as facts rather than guessing them from the text. They are shown in the business’s card and in the snippet, and AI assistants answer from them.

@seamlet/astro/search builds them from the presets, and the component StructuredData.astro renders them as one <script type="application/ld+json"> tag. Empty fields do not go into the data.

Function What it builds
localBusinessOf(...) The business for every page: the schema.org type (CafeOrCoffeeShop, Florist, HomeAndConstructionBusiness, LocalBusiness by default), phone, email, address, opening hours, photo, social links
businessContactsOf(contacts) The phone, the address, the map and the links of contactsFields() — spread them into localBusinessOf
productOf(product, { url }) A product of productFields(): name, description, photo and price in rubles. Several prices (prices, for example of sizes) give a range from and to
breadcrumbsOf([...]) The path from the home page to the page
faqPageOf(questions) The questions of the page with their answers — a plain or a formatted text

The business goes into the shared layout, on every page:

src/components/Layout.astro
---
import StructuredData from "@seamlet/astro/components/StructuredData.astro";
import {
businessContactsOf,
faqPageOf,
localBusinessOf,
} from "@seamlet/astro/search";
import type { SiteContent } from "../schema";
interface Props {
content: SiteContent;
}
const { content } = Astro.props;
const business = localBusinessOf({
type: "CafeOrCoffeeShop",
name: content.name,
url: Astro.site?.href ?? Astro.url.origin,
openingHours: content.openingHours,
...businessContactsOf(content.contacts),
});
const faq = faqPageOf(content.faq);
---
<head>
<StructuredData value={[business, faq]} />
</head>

Here content.openingHours is an openingHoursField(), content.contacts a contactsFields(), and content.faq a collection with the fields question and answer.

On a product’s page the product and the path to it are added to the business:

src/components/ProductPage.astro
---
import StructuredData from "@seamlet/astro/components/StructuredData.astro";
import { breadcrumbsOf, productOf } from "@seamlet/astro/search";
import { productPages, type SiteContent } from "../schema";
interface Props {
content: SiteContent;
record: SiteContent["products"][number];
index: number;
}
const { record } = Astro.props;
const siteUrl = Astro.site?.href ?? Astro.url.origin;
const url = new URL(productPages.pathOf(record) ?? "/catalog", siteUrl).href;
const product = productOf(record, { url, availability: "InStock" });
const breadcrumbs = breadcrumbsOf([
{ name: "Главная", url: new URL("/", siteUrl).href },
{ name: "Каталог", url: new URL("/catalog", siteUrl).href },
{ name: record.name, url },
]);
---
<StructuredData value={[product, breadcrumbs]} />

availability — whether the product is available now: InStock, OutOfStock, PreOrder, MadeToOrder and others. The price is always in rubles. A product without a price goes into the data without an offer.

A property the function does not have, add yourself — it is a plain object: { ...business, hasMenu: new URL("/menu", siteUrl).href }.

StructuredData.astro writes < as \u003c, so no text of the owner can close the tag. The browser does not run a data block, so a script-src 'self' policy lets it through — there is no need to change it.

The data must say what the visitor sees. A price, hours or a question that is not on the page is what search engines lower a site for.