@astrojs/starlight 0.5.6 → 0.6.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/404.astro +17 -17
- package/CHANGELOG.md +40 -2
- package/components/CallToAction.astro +32 -35
- package/components/ContentPanel.astro +18 -18
- package/components/EditLink.astro +23 -23
- package/components/FallbackContentNotice.astro +16 -18
- package/components/Footer.astro +28 -34
- package/components/HeadSEO.astro +69 -75
- package/components/Header.astro +47 -51
- package/components/Hero.astro +108 -121
- package/components/Icons.ts +73 -71
- package/components/LanguageSelect.astro +31 -31
- package/components/LastUpdated.astro +16 -18
- package/components/MarkdownContent.astro +105 -117
- package/components/MobileMenuToggle.astro +80 -80
- package/components/PrevNextLinks.astro +60 -60
- package/components/RightSidebar.astro +17 -17
- package/components/RightSidebarPanel.astro +41 -41
- package/components/Search.astro +293 -306
- package/components/Select.astro +64 -65
- package/components/Sidebar.astro +23 -23
- package/components/SidebarSublist.astro +96 -95
- package/components/SiteTitle.astro +65 -63
- package/components/SkipLink.astro +17 -17
- package/components/SocialIcons.astro +36 -34
- package/components/TableOfContents/MobileTableOfContents.astro +124 -124
- package/components/TableOfContents/TableOfContentsList.astro +64 -69
- package/components/TableOfContents/generateToC.ts +41 -43
- package/components/TableOfContents/starlight-toc.ts +84 -90
- package/components/TableOfContents.astro +8 -8
- package/components/ThemeProvider.astro +28 -32
- package/components/ThemeSelect.astro +66 -71
- package/global.d.ts +3 -3
- package/index.astro +1 -1
- package/index.ts +52 -59
- package/integrations/asides.ts +109 -111
- package/integrations/sitemap.ts +10 -13
- package/integrations/virtual-user-config.ts +37 -37
- package/layout/Page.astro +84 -72
- package/layout/PageFrame.astro +67 -69
- package/layout/TwoColumnContent.astro +40 -42
- package/package.json +2 -2
- package/schema.ts +126 -113
- package/schemas/favicon.ts +40 -0
- package/schemas/head.ts +12 -23
- package/schemas/i18n.ts +146 -160
- package/schemas/logo.ts +22 -22
- package/schemas/prevNextLink.ts +14 -14
- package/schemas/tableOfContents.ts +14 -18
- package/style/asides.css +27 -27
- package/style/props.css +168 -172
- package/style/reset.css +13 -13
- package/style/shiki.css +11 -11
- package/style/util.css +30 -30
- package/translations/fr.json +21 -21
- package/translations/index.ts +4 -4
- package/translations/it.json +20 -20
- package/translations/tr.json +1 -1
- package/translations/zh.json +0 -1
- package/user-components/Card.astro +50 -54
- package/user-components/CardGrid.astro +21 -21
- package/user-components/Icon.astro +19 -21
- package/user-components/TabItem.astro +3 -3
- package/user-components/Tabs.astro +113 -117
- package/user-components/rehype-tabs.ts +72 -72
- package/utils/base.ts +6 -6
- package/utils/git.ts +55 -55
- package/utils/head.ts +56 -54
- package/utils/i18n.ts +3 -3
- package/utils/localizedUrl.ts +25 -25
- package/utils/navigation.ts +225 -203
- package/utils/routing.ts +74 -85
- package/utils/slugs.ts +41 -51
- package/utils/translations.ts +26 -32
- package/utils/user-config.ts +278 -278
- package/virtual.d.ts +8 -8
|
@@ -1,135 +1,123 @@
|
|
|
1
1
|
<div class="content"><slot /></div>
|
|
2
2
|
|
|
3
3
|
<style>
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
.content
|
|
5
|
+
:global(
|
|
6
|
+
:not(a, strong, em, del, span, input)
|
|
7
|
+
+ :not(a, strong, em, del, span, input, :where(.not-content *))
|
|
8
|
+
) {
|
|
9
|
+
margin-top: 1.5rem;
|
|
10
|
+
}
|
|
11
11
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
}
|
|
12
|
+
/* Headings after non-headings have more spacing. */
|
|
13
|
+
.content
|
|
14
|
+
:global(
|
|
15
|
+
:not(h1, h2, h3, h4, h5, h6) + :is(h1, h2, h3, h4, h5, h6):not(:where(.not-content *))
|
|
16
|
+
) {
|
|
17
|
+
margin-top: 2.5rem;
|
|
18
|
+
}
|
|
20
19
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
20
|
+
.content :global(li + li:not(:where(.not-content *))),
|
|
21
|
+
.content :global(dt + dt:not(:where(.not-content *))),
|
|
22
|
+
.content :global(dt + dd:not(:where(.not-content *))),
|
|
23
|
+
.content :global(dd + dd:not(:where(.not-content *))) {
|
|
24
|
+
margin-top: 0.25rem;
|
|
25
|
+
}
|
|
27
26
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
em,
|
|
35
|
-
del,
|
|
36
|
-
span,
|
|
37
|
-
input,
|
|
38
|
-
:where(.not-content *)
|
|
39
|
-
)
|
|
40
|
-
) {
|
|
41
|
-
margin-bottom: 1.25rem;
|
|
42
|
-
}
|
|
27
|
+
.content
|
|
28
|
+
:global(
|
|
29
|
+
li > :last-child:not(li, ul, ol):not(a, strong, em, del, span, input, :where(.not-content *))
|
|
30
|
+
) {
|
|
31
|
+
margin-bottom: 1.25rem;
|
|
32
|
+
}
|
|
43
33
|
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
.content :global(dt:not(:where(.not-content *))) {
|
|
35
|
+
font-weight: 700;
|
|
36
|
+
}
|
|
37
|
+
.content :global(dd:not(:where(.not-content *))) {
|
|
38
|
+
padding-inline-start: 1rem;
|
|
39
|
+
}
|
|
50
40
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
41
|
+
.content :global(:is(h1, h2, h3, h4, h5, h6):not(:where(.not-content *))) {
|
|
42
|
+
color: var(--sl-color-white);
|
|
43
|
+
line-height: var(--sl-line-height-headings);
|
|
44
|
+
font-weight: 600;
|
|
45
|
+
}
|
|
56
46
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
max-width: 100%;
|
|
63
|
-
height: auto;
|
|
64
|
-
}
|
|
47
|
+
.content :global(:is(img, picture, video, canvas, svg, iframe):not(:where(.not-content *))) {
|
|
48
|
+
display: block;
|
|
49
|
+
max-width: 100%;
|
|
50
|
+
height: auto;
|
|
51
|
+
}
|
|
65
52
|
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
53
|
+
.content :global(h1:not(:where(.not-content *))) {
|
|
54
|
+
font-size: var(--sl-text-h1);
|
|
55
|
+
}
|
|
56
|
+
.content :global(h2:not(:where(.not-content *))) {
|
|
57
|
+
font-size: var(--sl-text-h2);
|
|
58
|
+
}
|
|
59
|
+
.content :global(h3:not(:where(.not-content *))) {
|
|
60
|
+
font-size: var(--sl-text-h3);
|
|
61
|
+
}
|
|
62
|
+
.content :global(h4:not(:where(.not-content *))) {
|
|
63
|
+
font-size: var(--sl-text-h4);
|
|
64
|
+
}
|
|
65
|
+
.content :global(h5:not(:where(.not-content *))) {
|
|
66
|
+
font-size: var(--sl-text-h5);
|
|
67
|
+
}
|
|
68
|
+
.content :global(h6:not(:where(.not-content *))) {
|
|
69
|
+
font-size: var(--sl-text-h6);
|
|
70
|
+
}
|
|
84
71
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
72
|
+
.content :global(a:not(:where(.not-content *))) {
|
|
73
|
+
color: var(--sl-color-text-accent);
|
|
74
|
+
}
|
|
75
|
+
.content :global(a:hover:not(:where(.not-content *))) {
|
|
76
|
+
color: var(--sl-color-white);
|
|
77
|
+
}
|
|
91
78
|
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
79
|
+
.content :global(code:not(:where(.not-content *))) {
|
|
80
|
+
background-color: var(--sl-color-bg-inline-code);
|
|
81
|
+
margin-block: -0.125rem;
|
|
82
|
+
padding: 0.125rem 0.375rem;
|
|
83
|
+
font-size: var(--sl-text-code-sm);
|
|
84
|
+
}
|
|
85
|
+
.content :global(:is(h1, h2, h3, h4, h5, h6) code) {
|
|
86
|
+
font-size: inherit;
|
|
87
|
+
}
|
|
101
88
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
89
|
+
.content :global(pre:not(:where(.not-content *))) {
|
|
90
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
91
|
+
padding: 0.75rem 1rem;
|
|
92
|
+
font-size: var(--sl-text-code);
|
|
93
|
+
tab-size: 2;
|
|
94
|
+
}
|
|
107
95
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
96
|
+
.content :global(pre code:not(:where(.not-content *))) {
|
|
97
|
+
all: unset;
|
|
98
|
+
font-family: var(--__sl-font-mono);
|
|
99
|
+
}
|
|
112
100
|
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
101
|
+
.content :global(blockquote:not(:where(.not-content *))) {
|
|
102
|
+
border-inline-start: 1px solid var(--sl-color-gray-5);
|
|
103
|
+
padding-inline-start: 1rem;
|
|
104
|
+
}
|
|
117
105
|
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
106
|
+
.content :global(table:not(:where(.not-content *))) {
|
|
107
|
+
display: block;
|
|
108
|
+
overflow: auto;
|
|
109
|
+
border-collapse: collapse;
|
|
110
|
+
}
|
|
111
|
+
.content :global(tr:nth-child(2n):not(:where(.not-content *))) {
|
|
112
|
+
background-color: var(--sl-color-gray-7, var(--sl-color-gray-6));
|
|
113
|
+
}
|
|
114
|
+
.content :global(:is(th, td):not(:where(.not-content *))) {
|
|
115
|
+
border: 1px solid var(--sl-color-hairline);
|
|
116
|
+
padding: 0.375rem 0.8125rem;
|
|
117
|
+
}
|
|
130
118
|
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
119
|
+
.content :global(hr:not(:where(.not-content *))) {
|
|
120
|
+
border: 0;
|
|
121
|
+
border-bottom: 1px solid var(--sl-color-hairline);
|
|
122
|
+
}
|
|
135
123
|
</style>
|
|
@@ -3,99 +3,99 @@ import Icon from '../user-components/Icon.astro';
|
|
|
3
3
|
import { useTranslations } from '../utils/translations';
|
|
4
4
|
|
|
5
5
|
interface Props {
|
|
6
|
-
|
|
6
|
+
locale: string | undefined;
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const t = useTranslations(Astro.props.locale);
|
|
10
10
|
---
|
|
11
11
|
|
|
12
12
|
<starlight-menu-button>
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
<button
|
|
14
|
+
aria-expanded="false"
|
|
15
|
+
aria-label={t('menuButton.accessibleLabel')}
|
|
16
|
+
aria-controls="starlight__sidebar"
|
|
17
|
+
class="flex md:hidden"
|
|
18
|
+
>
|
|
19
|
+
<Icon name="bars" />
|
|
20
|
+
</button>
|
|
21
21
|
</starlight-menu-button>
|
|
22
22
|
|
|
23
23
|
<script>
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
24
|
+
class StarlightMenuButton extends HTMLElement {
|
|
25
|
+
btn = this.querySelector('button')!;
|
|
26
|
+
|
|
27
|
+
constructor() {
|
|
28
|
+
super();
|
|
29
|
+
// Toggle `aria-expanded` state when a user clicks the button.
|
|
30
|
+
this.btn.addEventListener('click', () => this.toggleExpanded());
|
|
31
|
+
|
|
32
|
+
// Close the menu when a user presses the escape key.
|
|
33
|
+
const parentNav = this.closest('nav');
|
|
34
|
+
if (parentNav) {
|
|
35
|
+
parentNav.addEventListener('keyup', (e) => this.closeOnEscape(e));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
setExpanded(expanded: boolean) {
|
|
40
|
+
this.setAttribute('aria-expanded', String(expanded));
|
|
41
|
+
document.body.toggleAttribute('data-mobile-menu-expanded', expanded);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
toggleExpanded() {
|
|
45
|
+
this.setExpanded(this.getAttribute('aria-expanded') !== 'true');
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
closeOnEscape(e: KeyboardEvent) {
|
|
49
|
+
if (e.code === 'Escape') {
|
|
50
|
+
this.setExpanded(false);
|
|
51
|
+
this.btn.focus();
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
customElements.define('starlight-menu-button', StarlightMenuButton);
|
|
57
57
|
</script>
|
|
58
58
|
|
|
59
59
|
<style>
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
60
|
+
button {
|
|
61
|
+
position: fixed;
|
|
62
|
+
top: calc((var(--sl-nav-height) - var(--sl-menu-button-size)) / 2);
|
|
63
|
+
inset-inline-end: var(--sl-nav-pad-x);
|
|
64
|
+
z-index: var(--sl-z-index-navbar);
|
|
65
|
+
border: 0;
|
|
66
|
+
border-radius: 50%;
|
|
67
|
+
width: var(--sl-menu-button-size);
|
|
68
|
+
height: var(--sl-menu-button-size);
|
|
69
|
+
padding: 0.5rem;
|
|
70
|
+
background-color: var(--sl-color-white);
|
|
71
|
+
color: var(--sl-color-black);
|
|
72
|
+
box-shadow: var(--sl-shadow-md);
|
|
73
|
+
cursor: pointer;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
[aria-expanded='true'] button {
|
|
77
|
+
background-color: var(--sl-color-gray-2);
|
|
78
|
+
box-shadow: none;
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
:global([data-theme='light']) button {
|
|
82
|
+
background-color: var(--sl-color-black);
|
|
83
|
+
color: var(--sl-color-white);
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
:global([data-theme='light']) [aria-expanded='true'] button {
|
|
87
|
+
background-color: var(--sl-color-gray-5);
|
|
88
|
+
}
|
|
89
89
|
</style>
|
|
90
90
|
|
|
91
91
|
<style is:global>
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
92
|
+
[data-mobile-menu-expanded] {
|
|
93
|
+
overflow: hidden;
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
@media (min-width: 50rem) {
|
|
97
|
+
[data-mobile-menu-expanded] {
|
|
98
|
+
overflow: auto;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
101
|
</style>
|
|
@@ -4,10 +4,10 @@ import { useTranslations } from '../utils/translations';
|
|
|
4
4
|
import Icon from '../user-components/Icon.astro';
|
|
5
5
|
|
|
6
6
|
interface Props {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
7
|
+
prev: Link | undefined;
|
|
8
|
+
next: Link | undefined;
|
|
9
|
+
dir: 'ltr' | 'rtl';
|
|
10
|
+
locale: string | undefined;
|
|
11
11
|
}
|
|
12
12
|
|
|
13
13
|
const { prev, next, dir, locale } = Astro.props;
|
|
@@ -16,65 +16,65 @@ const t = useTranslations(locale);
|
|
|
16
16
|
---
|
|
17
17
|
|
|
18
18
|
<div class="pagination-links flex" dir={dir}>
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
19
|
+
{
|
|
20
|
+
prev && (
|
|
21
|
+
<a href={prev.href} rel="prev">
|
|
22
|
+
<Icon name={isRtl ? 'right-arrow' : 'left-arrow'} size="1.5rem" />
|
|
23
|
+
<span>
|
|
24
|
+
{t('page.previousLink')}
|
|
25
|
+
<br />
|
|
26
|
+
<span class="link-title">{prev.label}</span>
|
|
27
|
+
</span>
|
|
28
|
+
</a>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
31
|
+
{
|
|
32
|
+
next && (
|
|
33
|
+
<a href={next.href} rel="next">
|
|
34
|
+
<Icon name={isRtl ? 'left-arrow' : 'right-arrow'} size="1.5rem" />
|
|
35
|
+
<span>
|
|
36
|
+
{t('page.nextLink')}
|
|
37
|
+
<br />
|
|
38
|
+
<span class="link-title">{next.label}</span>
|
|
39
|
+
</span>
|
|
40
|
+
</a>
|
|
41
|
+
)
|
|
42
|
+
}
|
|
43
43
|
</div>
|
|
44
44
|
|
|
45
45
|
<style>
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
46
|
+
.pagination-links {
|
|
47
|
+
flex-wrap: wrap;
|
|
48
|
+
gap: 1rem;
|
|
49
|
+
}
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
51
|
+
a {
|
|
52
|
+
display: flex;
|
|
53
|
+
align-items: center;
|
|
54
|
+
justify-content: flex-start;
|
|
55
|
+
gap: 0.5rem;
|
|
56
|
+
width: 100%;
|
|
57
|
+
flex-basis: calc(50% - 0.5rem);
|
|
58
|
+
flex-grow: 1;
|
|
59
|
+
border: 1px solid var(--sl-color-gray-5);
|
|
60
|
+
border-radius: 0.5rem;
|
|
61
|
+
padding: 1rem;
|
|
62
|
+
text-decoration: none;
|
|
63
|
+
color: var(--sl-color-gray-2);
|
|
64
|
+
box-shadow: var(--sl-shadow-md);
|
|
65
|
+
}
|
|
66
|
+
[rel='next'] {
|
|
67
|
+
justify-content: end;
|
|
68
|
+
text-align: end;
|
|
69
|
+
flex-direction: row-reverse;
|
|
70
|
+
}
|
|
71
|
+
a:hover {
|
|
72
|
+
border-color: var(--sl-color-gray-2);
|
|
73
|
+
}
|
|
74
74
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
75
|
+
.link-title {
|
|
76
|
+
color: var(--sl-color-white);
|
|
77
|
+
font-size: var(--sl-text-2xl);
|
|
78
|
+
line-height: var(--sl-line-height-headings);
|
|
79
|
+
}
|
|
80
80
|
</style>
|
|
@@ -7,30 +7,30 @@ import { generateToC } from './TableOfContents/generateToC';
|
|
|
7
7
|
import { useTranslations } from '../utils/translations';
|
|
8
8
|
|
|
9
9
|
interface Props {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
headings: MarkdownHeading[];
|
|
11
|
+
locale: string | undefined;
|
|
12
|
+
tocConfig: { maxHeadingLevel: number; minHeadingLevel: number } | false;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
15
|
const { headings, locale, tocConfig } = Astro.props;
|
|
16
16
|
const t = useTranslations(locale);
|
|
17
17
|
const tocProps = tocConfig && {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
...tocConfig,
|
|
19
|
+
locale,
|
|
20
|
+
toc: generateToC(headings, {
|
|
21
|
+
...tocConfig,
|
|
22
|
+
title: t('tableOfContents.overview'),
|
|
23
|
+
}),
|
|
24
24
|
};
|
|
25
25
|
---
|
|
26
26
|
|
|
27
27
|
{
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
28
|
+
tocProps && (
|
|
29
|
+
<>
|
|
30
|
+
<MobileTableOfContents {...tocProps} />
|
|
31
|
+
<RightSidebarPanel>
|
|
32
|
+
<TableOfContents {...tocProps} />
|
|
33
|
+
</RightSidebarPanel>
|
|
34
|
+
</>
|
|
35
|
+
)
|
|
36
36
|
}
|