Documentation menu

Documentation › Your Astro site

The site kit

@galley/astro: forms, managed scripts with consent, email links, the agent-readable version of the site and the dev toolbar app — how a site gets it, every option, and what it adds to a build.

This page is for developers. Galley edits any Astro site without adding anything to it. The site kit is optional: an Astro integration, @galley/astro (packages/astro), that turns a few content files into site features:

FeatureThe fileGuide
Formssrc/content/forms/<id>.json + <Form id="…" />Forms
Third-party scripts with consentsrc/data/scripts.jsonScripts
Email links (Gmail, Outlook, mail app, copy)— (on by default)below
The agent-readable version: a markdown copy of every page, llms.txt, llms-full.txt, agent.md, structured data, robots.txt and sitemap.xml when the site has nonesrc/data/visibility.json (optional)below
The dev toolbar app: in astro dev, says whether Galley is running and opens the page in it—

Because forms and scripts are plain files, they are edited by Galley's form builder and Scripts screen, by its assistant, over MCP or by hand, and publish like any change.

Not on npm yet. The package is private in the repository; sites use it vendored — copied into the site as plain files. The starters ship it vendored, and so does this website.

Link to this section: Getting it into a site

The quickest way: open the site in Galley, go to Forms or Scripts, and press Set it up for me. It adds the kit's files and wires what is unambiguous — the three script placements when the site has exactly one layout writing its own <html>, the forms collection, the build step for the agent-readable version — as pending changes in Proof. When the layout isn't clear it says so, with the lines for a developer. It needs build mode to be allowed on the site.

By hand, from a clone of Galley:

sh
$ node packages/astro/scripts/vendor.mjs path/to/site

copies the components, the browser runtime, the schemas, the CSS and the build step into src/galley/, each file headed with the kit version it came from. Running it again replaces the kit files and keeps src/galley/settings.json. Then:

  • the forms collection in src/content.config.ts: import { formSchema } from "./galley/schema.js";
  • the three placements in the layout: <Scripts placement="head" /> after <meta charset>, "body-start" after <body>, "body-end" before </body> (import { Scripts } from "../galley/components/index.js");
  • for the agent-readable version: import galley from "./src/galley/integration.js" and integrations: [galley()] in astro.config.

Once the package is published: npx astro add @galley/astro, and the integration places the scripts itself — no template changes.

Link to this section: Options

galley(options) in astro.config. This site's build checks that this table lists exactly the options in packages/astro/src/index.d.ts.

OptionType and defaultMeaning
urlstring; GALLEY_URL, else http://127.0.0.1:4400Where the dev toolbar app looks for Galley.
toolbarboolean; trueThe dev toolbar app (astro dev only).
formsobject or false; onForms. false turns the part off.
forms.collectionstring; "forms"The content collection the forms live in.
forms.dirstring; "src/content/forms"Its folder, scanned for site-wide needs (UTM memory).
forms.endpointstringThe capture address for forms sending to Galley's inbox, e.g. https://cms.example.com/f/<siteId>.
forms.allowFormScriptsboolean; falseLet a form's script after-submit action run (custom code from the form file).
forms.messagesobjectSite-wide wording for every form, by key.
forms.freeEmailDomainsstring[]More domains a "business e-mail only" field refuses.
scriptsobject or false; onManaged scripts.
scripts.filestring; "src/data/scripts.json"The scripts file.
scripts.injectboolean; truePut the scripts into every page automatically. false: place <Scripts /> yourself.
mailtoobject or false; onThe email-link dialog.
mailto.optionsarray; ["gmail", "outlook", "app", "copy"]Which actions, in which order; "outlook-live" is also available.
mailto.stringsobjectIts wording, by key.
visibilityobject or false; onThe agent-readable version.
visibility.filestring; "src/data/visibility.json"Its data file.

With no forms, no scripts file, mailto: false and visibility: false, the build output is byte-identical with and without the integration (the kit's own test).

Every mailto: link opens a small dialog: Send with Gmail, Send with Outlook, Open my mail app, Copy address, with the recipients, subject and body carried into each. Without JavaScript it stays an ordinary mailto: link; a modified click (⌘/Ctrl, Shift, Alt) is left to the browser. Turn it off with mailto: false. Details, theming and wording: docs/mailto.md.

Link to this section: The agent-readable version

After the build the kit writes, from the rendered pages:

AddressWhat it is
/about.md for /about/, /index.md for the home pageThe page's main content as markdown, with its title, description, address and dates. No menus, forms or scripts.
/llms.txtA contents page for AI systems, each page linking to its markdown copy.
/llms-full.txtEvery markdown copy in one file, up to 1 MB.
/agent.mdA short guide for an AI agent: what the site is and how to cite it.
/robots.txt, /sitemap.xmlOnly when the site has none of its own. robots.txt carries the per-crawler AI choices.

Pages marked noindex, drafts and the not-found page are left out. Structured data is added only where the page's own facts make it complete and true. In astro dev the same addresses answer on request.

Status: agent-readable pages for the sites Galley builds are in progress, and so is the per-crawler switch in the app; this website runs the kit's version today. Google says its search doesn't use llms.txt or markdown copies, and few AI systems read them yet: the copies make a site easier for an agent to read, not more likely to be cited. Formats, the data file and sources: docs/ai-first-output.md.

Link to this section: Next