Some options may not fully work or be documented.
Sitemap and Robots
SolidBase can generate both /sitemap.xml and /robots.txt during the build so search engines can discover and crawl your docs more reliably.
Enable the feature
Set a canonical siteUrl, then turn both features on in your SolidBase config:
import { createSolidBase, defineTheme } from "@kobalte/solidbase/config";import defaultTheme from "@kobalte/solidbase/default-theme";
const theme = defineTheme({ componentsPath: import.meta.resolve("./src/solidbase-theme"), extends: defaultTheme,});
const solidBase = createSolidBase(theme);
export default { ...solidBase.startConfig({ ssr: true, }), plugins: [ solidBase.plugin({ title: "My Docs", description: "Documentation for my project", siteUrl: "https://docs.example.com", sitemap: true, robots: true, }), ],};With that config, SolidBase emits:
/sitemap.xmlwith fully-qualified canonical URLs/robots.txtwith an allow-all policy and aSitemap:reference
What goes into the sitemap
SolidBase builds the sitemap from markdown routes under src/routes.
.mdand.mdxroutes are included automatically[...404]routes are excluded- localized routes include
hreflangalternates - multilingual route groups include
x-defaultwhen a default-locale page exists
If your site grows large enough, SolidBase automatically switches from a single sitemap.xml file to a sitemap index plus chunked sitemap files.
Localized URLs
When you use lang and locales, SolidBase groups equivalent localized pages together in the sitemap.
// ..siteUrl: "https://docs.example.com",lang: "en-US",locales: { fr: { label: "Français", lang: "fr-FR", },},sitemap: true,// ..That means a page like /guide/getting-started can emit alternates for both en-US and fr-FR, plus x-default pointing at the default-locale URL.
Excluding pages from the sitemap
You can exclude individual pages with frontmatter:
---title: Internalsitemap: exclude: true---You can also disable sitemap inclusion entirely for a page with sitemap: false.
Custom sitemap and robots config
The default setup is enough for most sites. If you need more control, you can pass config objects instead of booleans.
// ..siteUrl: "https://docs.example.com",sitemap: { maxUrlsPerSitemap: 10000,},robots: { rules: [ { userAgent: "*", allow: ["/"], disallow: ["/admin/"], }, ],},// ..Use siteUrl for the normal case. Only override sitemap.hostname when your sitemap should use a different canonical host than the rest of the site.
Google-friendly defaults
SolidBase keeps the generated files intentionally conservative:
- sitemap URLs are absolute and canonical
priorityandchangefreqare omittedlastmodis omitted unless SolidBase can source it accurately in the futurerobots.txtallows crawling by default instead of blocking resources automatically
If you need page-level metadata details, see the Frontmatter reference. For the full config surface, see Configure Your App.
Last updated: 3/19/26, 8:19 PM
Edit this page on GitHub