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
Copy file name to clipboardExpand all lines: docs/src/content/docs/reference/configuration.mdx
+5-20
Original file line number
Diff line number
Diff line change
@@ -42,7 +42,6 @@ Set the description for your website. Used in metadata shared with search engine
42
42
Set a logo image to show in the navigation bar alongside or instead of the site title. You can either set a single `src` property or set separate image sources for `light` and `dark`.
43
43
44
44
```js
45
-
// astro.config.mjs
46
45
starlight({
47
46
logo: {
48
47
src:'./src/assets/my-logo.svg',
@@ -73,7 +72,6 @@ Configure the table of contents shown on the right of each page. By default, `<h
73
72
Enable “Edit this page” links by setting the base URL these should use. The final link will be `editLink.baseUrl` + the current page path. For example, to enable editing pages in the `withastro/starlight` repo on GitHub:
@@ -99,7 +97,6 @@ Each item must have a `label` and one of the following properties:
99
97
-`autogenerate` — an object specifying a directory of your docs to automatically generate a group of links from.
100
98
101
99
```js
102
-
// astro.config.mjs
103
100
starlight({
104
101
sidebar: [
105
102
// A single link item labelled “Home”.
@@ -132,8 +129,7 @@ Groups of links are expanded by default. You can change this behavior by setting
132
129
133
130
Autogenerated subgroups respect the `collapsed` property of their parent group by default. Set the `autogenerate.collapsed` property to override this.
134
131
135
-
```js {6,17}
136
-
// astro.config.mjs
132
+
```js {5,16}
137
133
sidebar: [
138
134
// A collapsed group of links.
139
135
{
@@ -159,8 +155,7 @@ sidebar: [
159
155
160
156
If your site is multilingual, each item’s `label` is considered to be in the default locale. You can set a `translations` property to provide labels for your other supported languages:
161
157
162
-
```js {6,10,15}
163
-
// astro.config.mjs
158
+
```js {5,9,14}
164
159
sidebar: [
165
160
// An example sidebar with labels translated to Brazilian Portuguese.
166
161
{
@@ -220,7 +215,6 @@ interface BadgeConfig {
220
215
Each entry should use the directory where that language’s files are saved as the key.
221
216
222
217
```js
223
-
// astro.config.mjs
224
218
import { defineConfig } from'astro/config';
225
219
importstarlightfrom'@astrojs/starlight';
226
220
@@ -285,8 +279,7 @@ The writing direction of this language; `"ltr"` for left-to-right (the default)
285
279
286
280
You can serve the default language without a `/lang/` directory by setting a `root` locale:
287
281
288
-
```js {4-7}
289
-
// astro.config.mjs
282
+
```js {3-6}
290
283
starlight({
291
284
locales: {
292
285
root: {
@@ -321,7 +314,6 @@ import SocialLinksType from '../../../components/social-links-type.astro';
321
314
Optional details about the social media accounts for this site. Adding any of these will display them as icon links in the site header.
322
315
323
316
```js
324
-
// astro.config.mjs
325
317
starlight({
326
318
social: {
327
319
codeberg:'https://codeberg.org/knut/examples',
@@ -348,7 +340,6 @@ Provide CSS files to customize the look and feel of your Starlight site.
348
340
Supports local CSS files relative to the root of your project, e.g. `'./src/custom.css'`, and CSS you installed as an npm module, e.g. `'@fontsource/roboto'`.
@@ -365,8 +356,7 @@ See the [“Code blocks” guide](/guides/authoring-content/#code-blocks) to lea
365
356
You can use any of the standard [Expressive Code configuration options](https://github.com/expressive-code/expressive-code/blob/main/packages/astro-expressive-code/README.md#configuration) as well as some Starlight-specific properties, by setting them in Starlight’s `expressiveCode` option.
366
357
For example, set Expressive Code’s `styleOverrides` option to override the default CSS. This enables customizations like giving your code blocks rounded corners:
367
358
368
-
```js ins={3-5}
369
-
// astro.config.mjs
359
+
```js ins={2-4}
370
360
starlight({
371
361
expressiveCode: {
372
362
styleOverrides: { borderRadius:'0.5rem' },
@@ -376,8 +366,7 @@ starlight({
376
366
377
367
If you want to disable Expressive Code, set `expressiveCode: false` in your Starlight config:
378
368
379
-
```js ins={3}
380
-
// astro.config.mjs
369
+
```js ins={2}
381
370
starlight({
382
371
expressiveCode:false,
383
372
});
@@ -430,7 +419,6 @@ Add custom tags to the `<head>` of your Starlight site.
430
419
Can be useful for adding analytics and other third-party scripts and resources.
431
420
432
421
```js
433
-
// astro.config.mjs
434
422
starlight({
435
423
head: [
436
424
// Example: add Fathom analytics script tag.
@@ -482,7 +470,6 @@ A page can override this setting or the link text and/or URL using the [`prev`](
482
470
Set the path of the default favicon for your website which should be located in the `public/` directory and be a valid (`.ico`, `.gif`, `.jpg`, `.png`, or `.svg`) icon file.
483
471
484
472
```js
485
-
// astro.config.mjs
486
473
starlight({
487
474
favicon:'/images/favicon.svg',
488
475
}),
@@ -491,7 +478,6 @@ starlight({
491
478
If you need to set additional variants or fallback favicons, you can add tags using the [`head` option](#head):
492
479
493
480
```js
494
-
// astro.config.mjs
495
481
starlight({
496
482
favicon:'/images/favicon.svg'.
497
483
head: [
@@ -525,7 +511,6 @@ For example, this page is titled “Configuration Reference” and this site is
525
511
Provide the paths to components to override Starlight’s default implementations.
0 commit comments