You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -73,11 +76,14 @@ There are several options for setting site-wide metadata and behavior. These opt
73
76
title: "My Documentation Site",
74
77
titleTemplate: "%s - MySite",
75
78
description: "A comprehensive guide to MySite.",
79
+
siteUrl: "https://docs.example.com",
76
80
logo: "/logo.png",
77
81
}
78
82
// ..
79
83
```
80
84
85
+
Set `siteUrl` to the canonical public URL for your site. SolidBase uses it as the shared base for generated sitemap URLs, `robots.txt`, and default Open Graph URL metadata.
86
+
81
87
:::note
82
88
For multilingual support, you can use the `locales` option to define different configurations for each locale. More details can be found in the [Internationalization guide](/guide/features/i18n).
83
89
:::
@@ -90,18 +96,65 @@ In addition to setting the site title and description, you can also configure ot
90
96
-`lastUpdated`: An object to configure the display of the last updated timestamp on each page. Set to `false` to disable this feature.
91
97
-`issueAutolink`: An object to configure automatic linking of issue references in your markdown content. Set to `false` to disable this feature.
92
98
-`llms`: Set to `true` to emit an `llms.txt` index and markdown copies of your routes for LLM-friendly documentation output.
99
+
-`sitemap`: Set to `true` to emit `/sitemap.xml`. You can also pass an object to override the hostname or control sitemap chunking for very large sites.
100
+
-`robots`: Set to `true` to emit a simple Google-friendly `/robots.txt` file that allows crawling and points to your sitemap.
See the [LLMs.txt guide](/guide/features/llms) for page-level exclusion and output details.
104
115
116
+
## Sitemap and robots
117
+
118
+
SolidBase can generate both `/sitemap.xml` and `/robots.txt` during the build.
119
+
120
+
```ts title="app.config.ts"
121
+
// ..
122
+
siteUrl: "https://docs.example.com",
123
+
sitemap: true,
124
+
robots: true,
125
+
// ..
126
+
```
127
+
128
+
This emits:
129
+
130
+
-`/sitemap.xml` with fully-qualified canonical URLs for your markdown routes
131
+
-`hreflang` alternates for localized routes, plus `x-default` when a default-locale route exists
132
+
-`/robots.txt` with an allow-all policy and a `Sitemap:` reference
133
+
134
+
If you need more control, `sitemap` also accepts an object:
135
+
136
+
```ts title="app.config.ts"
137
+
// ..
138
+
siteUrl: "https://docs.example.com",
139
+
sitemap: {
140
+
maxUrlsPerSitemap: 10000,
141
+
},
142
+
robots: {
143
+
rules: [
144
+
{
145
+
userAgent: "*",
146
+
allow: ["/"],
147
+
disallow: ["/admin/"],
148
+
},
149
+
],
150
+
},
151
+
// ..
152
+
```
153
+
154
+
Use `siteUrl` for the normal case. Override `sitemap.hostname` only when your sitemap should use a different canonical host than the rest of the site.
155
+
156
+
See the [Sitemap and robots guide](/guide/features/sitemap-and-robots) for a full walkthrough of localized alternates, page exclusion, and custom crawler rules.
157
+
105
158
### Markdown Configuration
106
159
107
160
In addition to the default markdown support provided by SolidBase, you can include additional markdown plugins, configurations, and other options through the `markdown` option.
-`/sitemap.xml` with fully-qualified canonical URLs
43
+
-`/robots.txt` with an allow-all policy and a `Sitemap:` reference
44
+
45
+
## What goes into the sitemap
46
+
47
+
SolidBase builds the sitemap from markdown routes under `src/routes`.
48
+
49
+
-`.md` and `.mdx` routes are included automatically
50
+
-`[...404]` routes are excluded
51
+
- localized routes include `hreflang` alternates
52
+
- multilingual route groups include `x-default` when a default-locale page exists
53
+
54
+
If your site grows large enough, SolidBase automatically switches from a single `sitemap.xml` file to a sitemap index plus chunked sitemap files.
55
+
56
+
## Localized URLs
57
+
58
+
When you use `lang` and `locales`, SolidBase groups equivalent localized pages together in the sitemap.
59
+
60
+
```ts title="app.config.ts"
61
+
// ..
62
+
siteUrl: "https://docs.example.com",
63
+
lang: "en-US",
64
+
locales: {
65
+
fr: {
66
+
label: "Français",
67
+
lang: "fr-FR",
68
+
},
69
+
},
70
+
sitemap: true,
71
+
// ..
72
+
```
73
+
74
+
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.
75
+
76
+
## Excluding pages from the sitemap
77
+
78
+
You can exclude individual pages with frontmatter:
79
+
80
+
```md title="src/routes/internal.mdx"
81
+
---
82
+
title: Internal
83
+
sitemap:
84
+
exclude: true
85
+
---
86
+
```
87
+
88
+
You can also disable sitemap inclusion entirely for a page with `sitemap: false`.
89
+
90
+
## Custom sitemap and robots config
91
+
92
+
The default setup is enough for most sites. If you need more control, you can pass config objects instead of booleans.
93
+
94
+
```ts title="app.config.ts"
95
+
// ..
96
+
siteUrl: "https://docs.example.com",
97
+
sitemap: {
98
+
maxUrlsPerSitemap: 10000,
99
+
},
100
+
robots: {
101
+
rules: [
102
+
{
103
+
userAgent: "*",
104
+
allow: ["/"],
105
+
disallow: ["/admin/"],
106
+
},
107
+
],
108
+
},
109
+
// ..
110
+
```
111
+
112
+
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.
113
+
114
+
## Google-friendly defaults
115
+
116
+
SolidBase keeps the generated files intentionally conservative:
117
+
118
+
- sitemap URLs are absolute and canonical
119
+
-`priority` and `changefreq` are omitted
120
+
-`lastmod` is omitted unless SolidBase can source it accurately in the future
121
+
-`robots.txt` allows crawling by default instead of blocking resources automatically
122
+
123
+
If you need page-level metadata details, see the [Frontmatter reference](/reference/frontmatter). For the full config surface, see [Configure Your App](/guide/config).
Copy file name to clipboardExpand all lines: docs/src/routes/guide/index.mdx
+4Lines changed: 4 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -19,6 +19,10 @@ Out of the box support for Markdown and MDX with almost all extensions you'd eve
19
19
20
20
Generate an `llms.txt` index and markdown mirrors of your docs for AI tooling and machine-readable documentation workflows. Learn more in the [LLMs.txt guide](/guide/features/llms).
21
21
22
+
### Search engine discovery
23
+
24
+
Generate a sitemap and `robots.txt` with localized alternates and sensible defaults for search crawlers. Learn more in the [Sitemap and robots guide](/guide/features/sitemap-and-robots).
25
+
22
26
### Customizable
23
27
24
28
All the SolidBase components can be overridden to transform your website into your own unique design. To see how, visit the [Extending Themes](/guide/customization/extending-themes) documentation.
0 commit comments