Generated Config From TOML
Taxo generates a config file from src/config/config.toml so the theme can use
those settings consistently during development and builds.
The two important files are:
- source:
src/config/config.toml - output:
.astro/config.generated.json
Many files import the generated JSON:
import config from ".astro/config.generated.json";Why Taxo Uses This File
This keeps config access simple across:
- Astro layouts
- utility functions
- page routes
- scripts
How It Gets Generated
The script is:
scripts/toml-watcher.mjs
And these commands depend on it, in the Astro edition:
{ "dev": "node scripts/dev.mjs", "build": "npm run toml:watch && astro build && npm run remove-draft-from-sitemap", "astro-check": "npm run toml:watch && astro check", "toml:watch": "node scripts/toml-watcher.mjs"}The editions differ. In the Sanity edition, dev is node scripts/dev.mjs, and the other three are the same. In the Tina edition, dev, build, and astro-check run node scripts/tina/run.mjs. Both do the same config steps.
What This Means In Practice
npm run devgenerates the file, watchesconfig.tomlfor changes, and starts the sitenpm run buildregenerates config before the production buildnpm run astro-checkregenerates config before it checks the code
If Changes Do Not Appear
If you update config.toml and do not see the result:
- make sure you started the project with
npm run dev - confirm
.astro/config.generated.jsonchanged - restart the dev server after multilingual routing changes
What Is Inconfig.toml
Each setting has a comment in the file.
| Table | Keys |
|---|---|
[site] | title, description, tagline, taglineSeparator, baseUrl, logo, logoAlternate, logoText, logoWidth, logoHeight, trailingSlash |
[site.favicon] | path, image |
[seo] | author, keywords, robots |
[seo.robotsTxt] | enable, disallow, aiSearch, aiTraining |
[seo.ai] | llmsTxt, markdownPages |
[seo.sitemap] | enable, exclude |
[settings] | blogFolder, serviceFolder, caseStudiesFolder, testimonialFolder, teamFolder, pagination, stickyHeader, pageHeaderDefaultImage, contactFormAction, contactFormProvider, footerDescription |
[settings.smoothScroll] | enable, respectReducedMotion, duration, easing, smoothWheel, syncTouch, wheelMultiplier, touchMultiplier, anchors, autoRaf, stopInertiaOnNavigate |
[settings.pageActions] | enable, footer, providers |
[settings.themeCredit] | enable, text = "...", url. This is the theme credit, editable here |
[settings.copyright] | enable, text |
[settings.subscription] | enable, title, note, formAction, mailchimpTagValue |
[settings.multilingual] | enable, defaultLanguage, disableLanguages, showDefaultLangInUrl |
[settings.contactInfo] | address, email, phone, mapLink |
[settings.headerOffcanvas] | enable, logo, description |
[settings.headerOffcanvas.button] | enable, label, url |
[settings.navigationButton] | enable, label, url |
[settings.announcementBar] | enable, label |
[settings.markup.tableOfContents] | enable, expanded, endLevel, ordered, startLevel |
[opengraph] | image, ogLocale, ogType, twitter, twitterCard |
[head] | content |
For the smooth scroll settings, see Smooth Scroll. For [seo.robotsTxt], [seo.ai], and [settings.pageActions], see AI Links & llms.
footerDescription under [settings], and title and note in [settings.subscription], don’t change what the footers show. Use footer.description and subscription.title in src/i18n/<lang>.json.
baseUrl is your site’s address. A SITE_URL environment variable overrides it for a build.
In the Tina edition, all of this is under Site settings at /admin/. In the Sanity edition, it is under Site settings in the Studio, and config.toml holds the defaults: a value in Site settings wins over the same value here. The language settings and the collection folder names stay in config.toml.
Rule Of Thumb
- edit
src/config/config.toml - never manually edit
.astro/config.generated.json