@astrojs/starlight 0.10.4 → 0.11.1
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 +9 -4
- package/CHANGELOG.md +77 -0
- package/components/Badge.astro +1 -0
- package/components/Banner.astro +4 -4
- package/components/ContentPanel.astro +4 -0
- package/components/EditLink.astro +5 -24
- package/components/FallbackContentNotice.astro +2 -5
- package/components/Footer.astro +5 -32
- package/components/{HeadSEO.astro → Head.astro} +10 -14
- package/components/Header.astro +26 -16
- package/components/Hero.astro +6 -9
- package/components/Icons.ts +31 -23
- package/components/LanguageSelect.astro +1 -4
- package/components/LastUpdated.astro +5 -24
- package/components/MarkdownContent.astro +4 -0
- package/components/MobileMenuFooter.astro +17 -0
- package/components/MobileMenuToggle.astro +2 -4
- package/components/{TableOfContents/MobileTableOfContents.astro → MobileTableOfContents.astro} +26 -29
- package/components/Page.astro +120 -0
- package/{layout → components}/PageFrame.astro +16 -8
- package/components/{RightSidebarPanel.astro → PageSidebar.astro} +21 -9
- package/components/PageTitle.astro +16 -0
- package/components/{PrevNextLinks.astro → Pagination.astro} +3 -9
- package/components/Search.astro +5 -5
- package/components/Sidebar.astro +7 -36
- package/components/SidebarSublist.astro +8 -2
- package/components/SiteTitle.astro +1 -20
- package/components/SkipLink.astro +3 -5
- package/components/SocialIcons.astro +5 -34
- package/components/TableOfContents/TableOfContentsList.astro +1 -1
- package/components/TableOfContents/starlight-toc.ts +3 -1
- package/components/TableOfContents.astro +12 -15
- package/components/ThemeProvider.astro +1 -0
- package/components/ThemeSelect.astro +1 -4
- package/{layout → components}/TwoColumnContent.astro +2 -4
- package/constants.ts +4 -0
- package/index.astro +4 -2
- package/index.ts +10 -15
- package/integrations/virtual-user-config.ts +3 -0
- package/package.json +133 -4
- package/props.ts +1 -0
- package/schema.ts +3 -0
- package/schemas/components.ts +256 -0
- package/schemas/sidebar.ts +89 -0
- package/schemas/social.ts +69 -0
- package/style/reset.css +1 -1
- package/translations/id.json +1 -1
- package/translations/index.ts +5 -1
- package/translations/ru.json +2 -2
- package/translations/uk.json +22 -0
- package/translations/vi.json +22 -0
- package/{components/TableOfContents → utils}/generateToC.ts +2 -1
- package/utils/navigation.ts +22 -5
- package/utils/route-data.ts +97 -0
- package/utils/routing.ts +10 -0
- package/utils/user-config.ts +15 -102
- package/utils/validateLogoImports.ts +21 -0
- package/virtual.d.ts +37 -0
- package/components/RightSidebar.astro +0 -36
- package/layout/Page.astro +0 -132
- /package/translations/{zh.json → zh-CN.json} +0 -0
package/components/Icons.ts
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
export const Icons = {
|
|
2
2
|
'up-caret':
|
|
3
|
-
'<path d="
|
|
3
|
+
'<path d="m17 13.41-4.29-4.24a.999.999 0 0 0-1.42 0l-4.24 4.24a1 1 0 1 0 1.41 1.42L12 11.29l3.54 3.54a1 1 0 0 0 1.41 0 1 1 0 0 0 .05-1.42Z"/>',
|
|
4
4
|
'down-caret':
|
|
5
|
-
'<path d="M17 9.
|
|
5
|
+
'<path d="M17 9.17a1 1 0 0 0-1.41 0L12 12.71 8.46 9.17a1 1 0 1 0-1.41 1.42l4.24 4.24a1.002 1.002 0 0 0 1.42 0L17 10.59a1.002 1.002 0 0 0 0-1.42Z"/>',
|
|
6
6
|
'right-caret':
|
|
7
|
-
'<path d="
|
|
7
|
+
'<path d="m14.83 11.29-4.24-4.24a1 1 0 1 0-1.42 1.41L12.71 12l-3.54 3.54a1 1 0 0 0 0 1.41 1 1 0 0 0 .71.29 1 1 0 0 0 .71-.29l4.24-4.24a1.002 1.002 0 0 0 0-1.42Z"/>',
|
|
8
8
|
'right-arrow':
|
|
9
|
-
'<path d="M17.92 11.
|
|
9
|
+
'<path d="M17.92 11.62a1.001 1.001 0 0 0-.21-.33l-5-5a1.003 1.003 0 1 0-1.42 1.42l3.3 3.29H7a1 1 0 0 0 0 2h7.59l-3.3 3.29a1.002 1.002 0 0 0 .325 1.639 1 1 0 0 0 1.095-.219l5-5a1 1 0 0 0 .21-.33 1 1 0 0 0 0-.76Z"/>',
|
|
10
10
|
'left-arrow':
|
|
11
|
-
'<path d="M17 11H9.
|
|
12
|
-
bars: '<path d="M3
|
|
11
|
+
'<path d="M17 11H9.41l3.3-3.29a1.004 1.004 0 1 0-1.42-1.42l-5 5a1 1 0 0 0-.21.33 1 1 0 0 0 0 .76 1 1 0 0 0 .21.33l5 5a1.002 1.002 0 0 0 1.639-.325 1 1 0 0 0-.219-1.095L9.41 13H17a1 1 0 0 0 0-2Z"/>',
|
|
12
|
+
bars: '<path d="M3 8h18a1 1 0 1 0 0-2H3a1 1 0 0 0 0 2Zm18 8H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Zm0-5H3a1 1 0 0 0 0 2h18a1 1 0 0 0 0-2Z"/>',
|
|
13
13
|
translate:
|
|
14
|
-
'<path fill-rule="evenodd"
|
|
14
|
+
'<path fill-rule="evenodd" d="M8.516 3a.94.94 0 0 0-.941.94v1.15H2.94a.94.94 0 1 0 0 1.882h7.362a7.422 7.422 0 0 1-1.787 3.958 7.42 7.42 0 0 1-1.422-2.425.94.94 0 1 0-1.774.627 9.303 9.303 0 0 0 1.785 3.043 7.422 7.422 0 0 1-4.164 1.278.94.94 0 1 0 0 1.881 9.303 9.303 0 0 0 5.575-1.855 9.303 9.303 0 0 0 4.11 1.74l-.763 1.525a.968.968 0 0 0-.016.034l-1.385 2.77a.94.94 0 1 0 1.683.841l1.133-2.267h5.806l1.134 2.267a.94.94 0 0 0 1.683-.841l-1.385-2.769a.95.95 0 0 0-.018-.036l-3.476-6.951a.94.94 0 0 0-1.682 0l-1.82 3.639a7.423 7.423 0 0 1-3.593-1.256 9.303 9.303 0 0 0 2.27-5.203h1.894a.94.94 0 0 0 0-1.881H9.456V3.94A.94.94 0 0 0 8.516 3Zm6.426 11.794a1.068 1.068 0 0 1-.02.039l-.703 1.407h3.924l-1.962-3.924-1.24 2.478Z" clip-rule="evenodd"/>',
|
|
15
15
|
pencil:
|
|
16
16
|
'<path d="M22 7.24a1 1 0 0 0-.29-.71l-4.24-4.24a1 1 0 0 0-1.1-.22 1 1 0 0 0-.32.22l-2.83 2.83L2.29 16.05a1 1 0 0 0-.29.71V21a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .76-.29l10.87-10.93L21.71 8c.1-.1.17-.2.22-.33a1 1 0 0 0 0-.24v-.14l.07-.05ZM6.83 20H4v-2.83l9.93-9.93 2.83 2.83L6.83 20ZM18.17 8.66l-2.83-2.83 1.42-1.41 2.82 2.82-1.41 1.42Z"/>',
|
|
17
17
|
pen: '<path d="M21 12a1 1 0 0 0-1 1v6a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h6a1 1 0 1 0 0-2H5a3 3 0 0 0-3 3v14a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-6a1 1 0 0 0-1-1Zm-15 .76V17a1 1 0 0 0 1 1h4.24a1 1 0 0 0 .71-.29l6.92-6.93L21.71 8a1 1 0 0 0 0-1.42l-4.24-4.29a1 1 0 0 0-1.42 0l-2.82 2.83-6.94 6.93a1 1 0 0 0-.29.71Zm10.76-8.35 2.83 2.83-1.42 1.42-2.83-2.83 1.42-1.42ZM8 13.17l5.93-5.93 2.83 2.83L10.83 16H8v-2.83Z"/>',
|
|
@@ -23,35 +23,35 @@ export const Icons = {
|
|
|
23
23
|
'<path d="m21.32 9.55-1.89-.63.89-1.78A1 1 0 0 0 20.13 6L18 3.87a1 1 0 0 0-1.15-.19l-1.78.89-.63-1.89A1 1 0 0 0 13.5 2h-3a1 1 0 0 0-.95.68l-.63 1.89-1.78-.89A1 1 0 0 0 6 3.87L3.87 6a1 1 0 0 0-.19 1.15l.89 1.78-1.89.63a1 1 0 0 0-.68.94v3a1 1 0 0 0 .68.95l1.89.63-.89 1.78A1 1 0 0 0 3.87 18L6 20.13a1 1 0 0 0 1.15.19l1.78-.89.63 1.89a1 1 0 0 0 .95.68h3a1 1 0 0 0 .95-.68l.63-1.89 1.78.89a1 1 0 0 0 1.13-.19L20.13 18a1 1 0 0 0 .19-1.15l-.89-1.78 1.89-.63a1 1 0 0 0 .68-.94v-3a1 1 0 0 0-.68-.95ZM20 12.78l-1.2.4A2 2 0 0 0 17.64 16l.57 1.14-1.1 1.1-1.11-.6a2 2 0 0 0-2.79 1.16l-.4 1.2h-1.59l-.4-1.2A2 2 0 0 0 8 17.64l-1.14.57-1.1-1.1.6-1.11a2 2 0 0 0-1.16-2.82l-1.2-.4v-1.56l1.2-.4A2 2 0 0 0 6.36 8l-.57-1.11 1.1-1.1L8 6.36a2 2 0 0 0 2.82-1.16l.4-1.2h1.56l.4 1.2A2 2 0 0 0 16 6.36l1.14-.57 1.1 1.1-.6 1.11a2 2 0 0 0 1.16 2.79l1.2.4v1.59ZM12 8a4 4 0 1 0 0 8 4 4 0 0 0 0-8Zm0 6a2 2 0 1 1 0-4 2 2 0 0 1 0 4Z"/>',
|
|
24
24
|
external:
|
|
25
25
|
'<path d="M19.33 10.18a1 1 0 0 1-.77 0 1 1 0 0 1-.62-.93l.01-1.83-8.2 8.2a1 1 0 0 1-1.41-1.42l8.2-8.2H14.7a1 1 0 0 1 0-2h4.25a1 1 0 0 1 1 1v4.25a1 1 0 0 1-.62.93Z"/><path d="M11 4a1 1 0 1 1 0 2H7a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h10a1 1 0 0 0 1-1v-4a1 1 0 1 1 2 0v4a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h4Z"/>',
|
|
26
|
-
moon: '<path d="M21.64
|
|
27
|
-
sun: '<path d="M5
|
|
26
|
+
moon: '<path d="M21.64 13a1 1 0 0 0-1.05-.14 8.049 8.049 0 0 1-3.37.73 8.15 8.15 0 0 1-8.14-8.1 8.59 8.59 0 0 1 .25-2A1 1 0 0 0 8 2.36a10.14 10.14 0 1 0 14 11.69 1 1 0 0 0-.36-1.05Zm-9.5 6.69A8.14 8.14 0 0 1 7.08 5.22v.27a10.15 10.15 0 0 0 10.14 10.14 9.784 9.784 0 0 0 2.1-.22 8.11 8.11 0 0 1-7.18 4.32v-.04Z"/>',
|
|
27
|
+
sun: '<path d="M5 12a1 1 0 0 0-1-1H3a1 1 0 0 0 0 2h1a1 1 0 0 0 1-1Zm.64 5-.71.71a1 1 0 0 0 0 1.41 1 1 0 0 0 1.41 0l.71-.71A1 1 0 0 0 5.64 17ZM12 5a1 1 0 0 0 1-1V3a1 1 0 0 0-2 0v1a1 1 0 0 0 1 1Zm5.66 2.34a1 1 0 0 0 .7-.29l.71-.71a1 1 0 1 0-1.41-1.41l-.66.71a1 1 0 0 0 0 1.41 1 1 0 0 0 .66.29Zm-12-.29a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.71-.71a1.004 1.004 0 1 0-1.43 1.41l.73.71ZM21 11h-1a1 1 0 0 0 0 2h1a1 1 0 0 0 0-2Zm-2.64 6A1 1 0 0 0 17 18.36l.71.71a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-.76-.66ZM12 6.5a5.5 5.5 0 1 0 5.5 5.5A5.51 5.51 0 0 0 12 6.5Zm0 9a3.5 3.5 0 1 1 0-7 3.5 3.5 0 0 1 0 7Zm0 3.5a1 1 0 0 0-1 1v1a1 1 0 0 0 2 0v-1a1 1 0 0 0-1-1Z"/>',
|
|
28
28
|
laptop:
|
|
29
|
-
'<path d="M21
|
|
29
|
+
'<path d="M21 14h-1V7a3 3 0 0 0-3-3H7a3 3 0 0 0-3 3v7H3a1 1 0 0 0-1 1v2a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3v-2a1 1 0 0 0-1-1ZM6 7a1 1 0 0 1 1-1h10a1 1 0 0 1 1 1v7H6V7Zm14 10a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1v-1h16v1Z"/>',
|
|
30
30
|
'open-book':
|
|
31
|
-
'<path d="M21.17 2.
|
|
31
|
+
'<path d="M21.17 2.06A13.1 13.1 0 0 0 19 1.87a12.94 12.94 0 0 0-7 2.05 12.94 12.94 0 0 0-7-2 13.1 13.1 0 0 0-2.17.19 1 1 0 0 0-.83 1v12a1 1 0 0 0 1.17 1 10.9 10.9 0 0 1 8.25 1.91l.12.07h.11a.91.91 0 0 0 .7 0h.11l.12-.07A10.899 10.899 0 0 1 20.83 16 1 1 0 0 0 22 15V3a1 1 0 0 0-.83-.94ZM11 15.35a12.87 12.87 0 0 0-6-1.48H4v-10c.333-.02.667-.02 1 0a10.86 10.86 0 0 1 6 1.8v9.68Zm9-1.44h-1a12.87 12.87 0 0 0-6 1.48V5.67a10.86 10.86 0 0 1 6-1.8c.333-.02.667-.02 1 0v10.04Zm1.17 4.15a13.098 13.098 0 0 0-2.17-.19 12.94 12.94 0 0 0-7 2.05 12.94 12.94 0 0 0-7-2.05c-.727.003-1.453.066-2.17.19A1 1 0 0 0 2 19.21a1 1 0 0 0 1.17.79 10.9 10.9 0 0 1 8.25 1.91 1 1 0 0 0 1.16 0A10.9 10.9 0 0 1 20.83 20a1 1 0 0 0 1.17-.79 1 1 0 0 0-.83-1.15Z"/>',
|
|
32
32
|
information:
|
|
33
|
-
'<path d="M12
|
|
33
|
+
'<path d="M12 11a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0v-4a1 1 0 0 0-1-1Zm.38-3.92a1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1.15 1.15 0 0 0-.21.33 1 1 0 0 0 .21 1.09c.097.088.209.16.33.21A1 1 0 0 0 13 8a1.05 1.05 0 0 0-.29-.71 1 1 0 0 0-.33-.21ZM12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16.001A8 8 0 0 1 12 20Z"/>',
|
|
34
34
|
magnifier:
|
|
35
|
-
'<path d="M21.71 20.
|
|
35
|
+
'<path d="M21.71 20.29 18 16.61A9 9 0 1 0 16.61 18l3.68 3.68a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.39ZM11 18a7 7 0 1 1 0-14 7 7 0 0 1 0 14Z"/>',
|
|
36
36
|
'forward-slash':
|
|
37
|
-
'<path d="M17
|
|
37
|
+
'<path d="M17 2H7a5 5 0 0 0-5 5v10a5 5 0 0 0 5 5h10a5 5 0 0 0 5-5V7a5 5 0 0 0-5-5Zm3 15a3 3 0 0 1-3 3H7a3 3 0 0 1-3-3V7a3 3 0 0 1 3-3h10a3 3 0 0 1 3 3v10Z"/><path d="M15.293 6.707a1 1 0 1 1 1.414 1.414l-8.485 8.486a1 1 0 0 1-1.414-1.415l8.485-8.485Z"/>',
|
|
38
38
|
close:
|
|
39
|
-
'<path d="
|
|
39
|
+
'<path d="m13.41 12 6.3-6.29a1.004 1.004 0 1 0-1.42-1.42L12 10.59l-6.29-6.3a1.004 1.004 0 0 0-1.42 1.42l6.3 6.29-6.3 6.29a1 1 0 0 0 0 1.42.998.998 0 0 0 1.42 0l6.29-6.3 6.29 6.3a.999.999 0 0 0 1.42 0 1 1 0 0 0 0-1.42L13.41 12Z"/>',
|
|
40
40
|
error:
|
|
41
|
-
'<path d="M12
|
|
41
|
+
'<path d="M12 7a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V8a1 1 0 0 0-1-1Zm0 8a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm9.71-7.44-5.27-5.27a1.05 1.05 0 0 0-.71-.29H8.27a1.05 1.05 0 0 0-.71.29L2.29 7.56a1.05 1.05 0 0 0-.29.71v7.46c.004.265.107.518.29.71l5.27 5.27c.192.183.445.286.71.29h7.46a1.05 1.05 0 0 0 .71-.29l5.27-5.27a1.05 1.05 0 0 0 .29-.71V8.27a1.05 1.05 0 0 0-.29-.71ZM20 15.31 15.31 20H8.69L4 15.31V8.69L8.69 4h6.62L20 8.69v6.62Z"/>',
|
|
42
42
|
warning:
|
|
43
|
-
'<path d="M12
|
|
43
|
+
'<path d="M12 16a1 1 0 1 0 0 2 1 1 0 0 0 0-2Zm10.67 1.47-8.05-14a3 3 0 0 0-5.24 0l-8 14A3 3 0 0 0 3.94 22h16.12a3 3 0 0 0 2.61-4.53Zm-1.73 2a1 1 0 0 1-.88.51H3.94a1 1 0 0 1-.88-.51 1 1 0 0 1 0-1l8-14a1 1 0 0 1 1.78 0l8.05 14a1 1 0 0 1 .05 1.02v-.02ZM12 8a1 1 0 0 0-1 1v4a1 1 0 0 0 2 0V9a1 1 0 0 0-1-1Z"/>',
|
|
44
44
|
'approve-check-circle':
|
|
45
|
-
'<path d="
|
|
45
|
+
'<path d="m14.72 8.79-4.29 4.3-1.65-1.65a1 1 0 1 0-1.41 1.41l2.35 2.36a1 1 0 0 0 1.41 0l5-5a1.002 1.002 0 1 0-1.41-1.42ZM12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm0 18a8 8 0 1 1 0-16.001A8 8 0 0 1 12 20Z"/>',
|
|
46
46
|
'approve-check':
|
|
47
|
-
'<path d="M18.71 7.
|
|
47
|
+
'<path d="M18.71 7.21a1 1 0 0 0-1.42 0l-7.45 7.46-3.13-3.14A1.02 1.02 0 1 0 5.29 13l3.84 3.84a1.001 1.001 0 0 0 1.42 0l8.16-8.16a1 1 0 0 0 0-1.47Z"/>',
|
|
48
48
|
rocket:
|
|
49
|
-
'<path fill-rule="evenodd"
|
|
49
|
+
'<path fill-rule="evenodd" d="M1.44 8.855v-.001l3.527-3.516c.34-.344.802-.541 1.285-.548h6.649l.947-.947c3.07-3.07 6.207-3.072 7.62-2.868a1.821 1.821 0 0 1 1.557 1.557c.204 1.413.203 4.55-2.868 7.62l-.946.946v6.649a1.845 1.845 0 0 1-.549 1.286l-3.516 3.528a1.844 1.844 0 0 1-3.11-.944l-.858-4.275-4.52-4.52-2.31-.463-1.964-.394A1.847 1.847 0 0 1 .98 10.693a1.843 1.843 0 0 1 .46-1.838Zm5.379 2.017-3.873-.776L6.32 6.733h4.638l-4.14 4.14Zm8.403-5.655c2.459-2.46 4.856-2.463 5.89-2.33.134 1.035.13 3.432-2.329 5.891l-6.71 6.71-3.561-3.56 6.71-6.711Zm-1.318 15.837-.776-3.873 4.14-4.14v4.639l-3.364 3.374Z" clip-rule="evenodd"/><path d="M9.318 18.345a.972.972 0 0 0-1.86-.561c-.482 1.435-1.687 2.204-2.934 2.619a8.22 8.22 0 0 1-1.23.302c.062-.365.157-.79.303-1.229.415-1.247 1.184-2.452 2.62-2.935a.971.971 0 1 0-.62-1.842c-.12.04-.236.084-.35.13-2.02.828-3.012 2.588-3.493 4.033a10.383 10.383 0 0 0-.51 2.845l-.001.016v.063c0 .536.434.972.97.972H2.24a7.21 7.21 0 0 0 .878-.065c.527-.063 1.248-.19 2.02-.447 1.445-.48 3.205-1.472 4.033-3.494a5.828 5.828 0 0 0 .147-.407Z"/>',
|
|
50
50
|
star: '<path d="M22 9.67a1 1 0 0 0-.86-.67l-5.69-.83L12.9 3a1 1 0 0 0-1.8 0L8.55 8.16 2.86 9a1 1 0 0 0-.81.68 1 1 0 0 0 .25 1l4.13 4-1 5.68a1 1 0 0 0 1.45 1.07L12 18.76l5.1 2.68c.14.08.3.12.46.12a1 1 0 0 0 .99-1.19l-1-5.68 4.13-4A1 1 0 0 0 22 9.67Zm-6.15 4a1 1 0 0 0-.29.89l.72 4.19-3.76-2a1 1 0 0 0-.94 0l-3.76 2 .72-4.19a1 1 0 0 0-.29-.89l-3-3 4.21-.61a1 1 0 0 0 .76-.55L12 5.7l1.88 3.82a1 1 0 0 0 .76.55l4.21.61-3 2.99Z"/>',
|
|
51
51
|
puzzle:
|
|
52
52
|
'<path d="M17 22H5a3 3 0 0 1-3-3V9a3 3 0 0 1 3-3h1a4 4 0 0 1 7.3-2.18c.448.64.692 1.4.7 2.18h3a1 1 0 0 1 1 1v3a4 4 0 0 1 2.18 7.3A3.86 3.86 0 0 1 18 18v3a1 1 0 0 1-1 1ZM5 8a1 1 0 0 0-1 1v10a1 1 0 0 0 1 1h11v-3.18a1 1 0 0 1 1.33-.95 1.77 1.77 0 0 0 1.74-.23 2 2 0 0 0 .93-1.37 2 2 0 0 0-.48-1.59 1.89 1.89 0 0 0-2.17-.55 1 1 0 0 1-1.33-.95V8h-3.2a1 1 0 0 1-1-1.33 1.77 1.77 0 0 0-.23-1.74 1.939 1.939 0 0 0-3-.43A2 2 0 0 0 8 6c.002.23.046.456.13.67A1 1 0 0 1 7.18 8H5Z"/>',
|
|
53
53
|
'list-format':
|
|
54
|
-
'<path d="M3.71 16.
|
|
54
|
+
'<path d="M3.71 16.29a1 1 0 0 0-.33-.21 1 1 0 0 0-.76 0 1 1 0 0 0-.33.21 1 1 0 0 0-.21.33 1 1 0 0 0 .21 1.09c.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1 1 0 0 0 .21-1.09 1 1 0 0 0-.21-.33ZM7 8h14a1 1 0 1 0 0-2H7a1 1 0 0 0 0 2Zm-3.29 3.29a1 1 0 0 0-1.09-.21 1.15 1.15 0 0 0-.33.21 1 1 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a.94.94 0 0 0 .76 0 1.15 1.15 0 0 0 .33-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1 1 0 0 0-.21-.33ZM21 11H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2ZM3.71 6.29a1 1 0 0 0-.33-.21 1 1 0 0 0-1.09.21 1.15 1.15 0 0 0-.21.33.94.94 0 0 0 0 .76c.05.121.122.233.21.33.097.088.209.16.33.21a1 1 0 0 0 1.09-.21 1.15 1.15 0 0 0 .21-.33.94.94 0 0 0 0-.76 1.15 1.15 0 0 0-.21-.33ZM21 16H7a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Z"/>',
|
|
55
55
|
random:
|
|
56
56
|
'<path d="M8.7 10a1 1 0 0 0 1.41 0 1 1 0 0 0 0-1.41l-6.27-6.3a1 1 0 0 0-1.42 1.42ZM21 14a1 1 0 0 0-1 1v3.59L15.44 14A1 1 0 0 0 14 15.44L18.59 20H15a1 1 0 0 0 0 2h6a1 1 0 0 0 .38-.08 1 1 0 0 0 .54-.54A1 1 0 0 0 22 21v-6a1 1 0 0 0-1-1Zm.92-11.38a1 1 0 0 0-.54-.54A1 1 0 0 0 21 2h-6a1 1 0 0 0 0 2h3.59L2.29 20.29a1 1 0 0 0 0 1.42 1 1 0 0 0 1.42 0L20 5.41V9a1 1 0 0 0 2 0V3a1 1 0 0 0-.08-.38Z"/>',
|
|
57
57
|
github:
|
|
@@ -89,6 +89,14 @@ export const Icons = {
|
|
|
89
89
|
stackOverflow:
|
|
90
90
|
'<path d="M15.72 0 14 1.28l6.4 8.58 1.7-1.26L15.73 0zm-3.94 3.42-1.36 1.64 8.22 6.85 1.37-1.64-8.23-6.85zM8.64 7.88l-.91 1.94 9.7 4.52.9-1.94-9.7-4.52zm-1.86 4.86-.44 2.1 10.48 2.2.44-2.1-10.47-2.2zM1.9 15.47V24h19.19v-8.53h-2.13v6.4H4.02v-6.4H1.9zm4.26 2.13v2.13h10.66V17.6H6.15Z"/>',
|
|
91
91
|
telegram:
|
|
92
|
-
'<path d="M22.
|
|
93
|
-
rss: '<path d="M2.88
|
|
92
|
+
'<path d="M22.265 2.428a2.048 2.048 0 0 0-2.078-.324L2.266 9.339a2.043 2.043 0 0 0 .104 3.818l3.625 1.261 2.02 6.682a.998.998 0 0 0 .119.252c.008.012.019.02.027.033a.988.988 0 0 0 .211.215.972.972 0 0 0 .07.05.986.986 0 0 0 .31.136l.013.001.006.003a1.022 1.022 0 0 0 .203.02l.018-.003a.993.993 0 0 0 .301-.052c.023-.008.042-.02.064-.03a.993.993 0 0 0 .205-.114 250.76 250.76 0 0 1 .152-.129l2.702-2.983 4.03 3.122a2.023 2.023 0 0 0 1.241.427 2.054 2.054 0 0 0 2.008-1.633l3.263-16.017a2.03 2.03 0 0 0-.693-1.97ZM9.37 14.736a.994.994 0 0 0-.272.506l-.31 1.504-.784-2.593 4.065-2.117Zm8.302 5.304-4.763-3.69a1.001 1.001 0 0 0-1.353.12l-.866.955.306-1.487 7.083-7.083a1 1 0 0 0-1.169-1.593L6.745 12.554 3.02 11.191 20.999 4Z"/>',
|
|
93
|
+
rss: '<path d="M2.88 16.88a3 3 0 0 0 0 4.24 3 3 0 0 0 4.24 0 3 3 0 0 0-4.24-4.24Zm2.83 2.83a1 1 0 0 1-1.42-1.42 1 1 0 0 1 1.42 0 1 1 0 0 1 0 1.42ZM5 12a1 1 0 0 0 0 2 5 5 0 0 1 5 5 1 1 0 0 0 2 0 7 7 0 0 0-7-7Zm0-4a1 1 0 0 0 0 2 9 9 0 0 1 9 9 1 1 0 0 0 2 0 11.08 11.08 0 0 0-3.22-7.78A11.08 11.08 0 0 0 5 8Zm10.61.39A15.11 15.11 0 0 0 5 4a1 1 0 0 0 0 2 13 13 0 0 1 13 13 1 1 0 0 0 2 0 15.11 15.11 0 0 0-4.39-10.61Z"/>',
|
|
94
|
+
facebook:
|
|
95
|
+
'<path d="M20.9 2H3.1A1.1 1.1 0 0 0 2 3.1v17.8A1.1 1.1 0 0 0 3.1 22h9.58v-7.75h-2.6v-3h2.6V9a3.64 3.64 0 0 1 3.88-4 20.26 20.26 0 0 1 2.33.12v2.7H17.3c-1.26 0-1.5.6-1.5 1.47v1.93h3l-.39 3H15.8V22h5.1a1.1 1.1 0 0 0 1.1-1.1V3.1A1.1 1.1 0 0 0 20.9 2Z"/>',
|
|
96
|
+
email:
|
|
97
|
+
'<path d="M19 4H5a3 3 0 0 0-3 3v10a3 3 0 0 0 3 3h14a3 3 0 0 0 3-3V7a3 3 0 0 0-3-3Zm-.41 2-5.88 5.88a1 1 0 0 1-1.42 0L5.41 6ZM20 17a1 1 0 0 1-1 1H5a1 1 0 0 1-1-1V7.41l5.88 5.88a3 3 0 0 0 4.24 0L20 7.41Z"/>',
|
|
98
|
+
reddit:
|
|
99
|
+
'<path d="M14.41 16.87a3.38 3.38 0 0 1-2.37.63 3.37 3.37 0 0 1-2.36-.63 1 1 0 0 0-1.42 1.41 5.11 5.11 0 0 0 3.78 1.22 5.12 5.12 0 0 0 3.78-1.22 1 1 0 1 0-1.41-1.41ZM9.2 15a1 1 0 1 0-1-1 1 1 0 0 0 1 1Zm6-2a1 1 0 1 0 1 1 1 1 0 0 0-1-1Zm7.8-1.22a3.77 3.77 0 0 0-6.8-2.26 16.5 16.5 0 0 0-3.04-.48l.85-5.7 2.09.7a3 3 0 0 0 6-.06v-.02a3.03 3.03 0 0 0-3-2.96 2.98 2.98 0 0 0-2.34 1.16l-3.24-1.1a1 1 0 0 0-1.3.8l-1.09 7.17a16.66 16.66 0 0 0-3.34.49 3.77 3.77 0 0 0-6.22 4.23A4.86 4.86 0 0 0 1 16c0 3.92 4.83 7 11 7s11-3.08 11-7a4.86 4.86 0 0 0-.57-2.25 3.78 3.78 0 0 0 .57-1.97ZM19.1 3a1 1 0 1 1-1 1 1.02 1.02 0 0 1 1-1ZM4.77 10a1.76 1.76 0 0 1 .88.25A9.98 9.98 0 0 0 3 11.92v-.14A1.78 1.78 0 0 1 4.78 10ZM12 21c-4.88 0-9-2.29-9-5s4.12-5 9-5 9 2.29 9 5-4.12 5-9 5Zm8.99-9.08a9.98 9.98 0 0 0-2.65-1.67 1.76 1.76 0 0 1 .88-.25A1.78 1.78 0 0 1 21 11.78l-.01.14Z"/>',
|
|
100
|
+
patreon:
|
|
101
|
+
'<path d="M22.04 7.6c0-2.8-2.19-5.1-4.75-5.93a15.19 15.19 0 0 0-10.44.55C3.16 3.96 2 7.78 1.95 11.58c-.02 3.12.3 11.36 4.94 11.42 3.45.04 3.97-4.4 5.56-6.55 1.14-1.52 2.6-1.95 4.4-2.4 3.1-.76 5.2-3.2 5.2-6.44Z"/>',
|
|
94
102
|
};
|
|
@@ -3,10 +3,7 @@ import config from 'virtual:starlight/user-config';
|
|
|
3
3
|
import { localizedUrl } from '../utils/localizedUrl';
|
|
4
4
|
import { useTranslations } from '../utils/translations';
|
|
5
5
|
import Select from './Select.astro';
|
|
6
|
-
|
|
7
|
-
interface Props {
|
|
8
|
-
locale: string | undefined;
|
|
9
|
-
}
|
|
6
|
+
import type { Props } from '../props';
|
|
10
7
|
|
|
11
8
|
/**
|
|
12
9
|
* Get the equivalent of the current page path for the passed locale.
|
|
@@ -1,36 +1,17 @@
|
|
|
1
1
|
---
|
|
2
|
-
import type {
|
|
3
|
-
import { fileURLToPath } from 'node:url';
|
|
4
|
-
import project from 'virtual:starlight/project-context';
|
|
5
|
-
import { getFileCommitDate } from '../utils/git';
|
|
2
|
+
import type { Props } from '../props';
|
|
6
3
|
import { useTranslations } from '../utils/translations';
|
|
7
4
|
|
|
8
|
-
|
|
9
|
-
id: CollectionEntry<'docs'>['id'];
|
|
10
|
-
lang: string;
|
|
11
|
-
lastUpdated: Date | undefined;
|
|
12
|
-
locale: string | undefined;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
const { id, lang, lastUpdated, locale } = Astro.props;
|
|
5
|
+
const { lang, lastUpdated, locale } = Astro.props;
|
|
16
6
|
const t = useTranslations(locale);
|
|
17
|
-
|
|
18
|
-
const currentFilePath = fileURLToPath(new URL('src/content/docs/' + id, project.root));
|
|
19
|
-
|
|
20
|
-
let date = lastUpdated;
|
|
21
|
-
try {
|
|
22
|
-
if (!date) {
|
|
23
|
-
({ date } = getFileCommitDate(currentFilePath, 'newest'));
|
|
24
|
-
}
|
|
25
|
-
} catch {}
|
|
26
7
|
---
|
|
27
8
|
|
|
28
9
|
{
|
|
29
|
-
|
|
10
|
+
lastUpdated && (
|
|
30
11
|
<p>
|
|
31
12
|
{t('page.lastUpdated')}{' '}
|
|
32
|
-
<time datetime={
|
|
33
|
-
{
|
|
13
|
+
<time datetime={lastUpdated.toISOString()}>
|
|
14
|
+
{lastUpdated.toLocaleDateString(lang, { dateStyle: 'medium' })}
|
|
34
15
|
</time>
|
|
35
16
|
</p>
|
|
36
17
|
)
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
import { LanguageSelect, ThemeSelect } from 'virtual:starlight/components';
|
|
3
|
+
import type { Props } from '../props';
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
<div class="mobile-preferences sl-flex">
|
|
7
|
+
<ThemeSelect {...Astro.props} />
|
|
8
|
+
<LanguageSelect {...Astro.props} />
|
|
9
|
+
</div>
|
|
10
|
+
|
|
11
|
+
<style>
|
|
12
|
+
.mobile-preferences {
|
|
13
|
+
justify-content: space-between;
|
|
14
|
+
border-top: 1px solid var(--sl-color-gray-6);
|
|
15
|
+
padding: 0.5rem 0;
|
|
16
|
+
}
|
|
17
|
+
</style>
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
---
|
|
2
|
-
import
|
|
2
|
+
import type { Props } from '../props';
|
|
3
3
|
import { useTranslations } from '../utils/translations';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
locale: string | undefined;
|
|
7
|
-
}
|
|
5
|
+
import Icon from '../user-components/Icon.astro';
|
|
8
6
|
|
|
9
7
|
const t = useTranslations(Astro.props.locale);
|
|
10
8
|
---
|
package/components/{TableOfContents/MobileTableOfContents.astro → MobileTableOfContents.astro}
RENAMED
|
@@ -1,36 +1,33 @@
|
|
|
1
1
|
---
|
|
2
|
-
import { useTranslations } from '
|
|
3
|
-
import Icon from '
|
|
4
|
-
import TableOfContentsList from './TableOfContentsList.astro';
|
|
5
|
-
import type {
|
|
2
|
+
import { useTranslations } from '../utils/translations';
|
|
3
|
+
import Icon from '../user-components/Icon.astro';
|
|
4
|
+
import TableOfContentsList from './TableOfContents/TableOfContentsList.astro';
|
|
5
|
+
import type { Props } from '../props';
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
toc: TocItem[];
|
|
9
|
-
locale: string | undefined;
|
|
10
|
-
maxHeadingLevel: number;
|
|
11
|
-
minHeadingLevel: number;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
const { locale, toc, maxHeadingLevel, minHeadingLevel } = Astro.props;
|
|
7
|
+
const { locale, toc } = Astro.props;
|
|
15
8
|
const t = useTranslations(locale);
|
|
16
9
|
---
|
|
17
10
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
<
|
|
21
|
-
<
|
|
22
|
-
<
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
</
|
|
11
|
+
{
|
|
12
|
+
toc && (
|
|
13
|
+
<mobile-starlight-toc data-min-h={toc.minHeadingLevel} data-max-h={toc.maxHeadingLevel}>
|
|
14
|
+
<nav aria-labelledby="starlight__on-this-page--mobile">
|
|
15
|
+
<details id="starlight__mobile-toc">
|
|
16
|
+
<summary id="starlight__on-this-page--mobile" class="sl-flex">
|
|
17
|
+
<div class="toggle sl-flex">
|
|
18
|
+
{t('tableOfContents.onThisPage')}
|
|
19
|
+
<Icon name={'right-caret'} class="caret" size="1rem" />
|
|
20
|
+
</div>
|
|
21
|
+
<span class="display-current" />
|
|
22
|
+
</summary>
|
|
23
|
+
<div class="dropdown">
|
|
24
|
+
<TableOfContentsList toc={toc.items} isMobile />
|
|
25
|
+
</div>
|
|
26
|
+
</details>
|
|
27
|
+
</nav>
|
|
28
|
+
</mobile-starlight-toc>
|
|
29
|
+
)
|
|
30
|
+
}
|
|
34
31
|
|
|
35
32
|
<style>
|
|
36
33
|
nav {
|
|
@@ -112,7 +109,7 @@ const t = useTranslations(locale);
|
|
|
112
109
|
</style>
|
|
113
110
|
|
|
114
111
|
<script>
|
|
115
|
-
import { StarlightTOC } from './starlight-toc';
|
|
112
|
+
import { StarlightTOC } from './TableOfContents/starlight-toc';
|
|
116
113
|
|
|
117
114
|
class MobileStarlightTOC extends StarlightTOC {
|
|
118
115
|
override set current(link: HTMLAnchorElement) {
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
---
|
|
2
|
+
import type { Props } from '../props';
|
|
3
|
+
|
|
4
|
+
// Built-in CSS styles.
|
|
5
|
+
import '../style/props.css';
|
|
6
|
+
import '../style/reset.css';
|
|
7
|
+
import '../style/shiki.css';
|
|
8
|
+
import '../style/util.css';
|
|
9
|
+
|
|
10
|
+
// Components — can override built-in CSS, but not user CSS.
|
|
11
|
+
import {
|
|
12
|
+
Banner,
|
|
13
|
+
ContentPanel,
|
|
14
|
+
PageTitle,
|
|
15
|
+
FallbackContentNotice,
|
|
16
|
+
Footer,
|
|
17
|
+
Header,
|
|
18
|
+
Head,
|
|
19
|
+
Hero,
|
|
20
|
+
MarkdownContent,
|
|
21
|
+
PageSidebar,
|
|
22
|
+
Sidebar,
|
|
23
|
+
SkipLink,
|
|
24
|
+
ThemeProvider,
|
|
25
|
+
PageFrame,
|
|
26
|
+
TwoColumnContent,
|
|
27
|
+
} from 'virtual:starlight/components';
|
|
28
|
+
|
|
29
|
+
// Remark component CSS (needs to override `MarkdownContent.astro`)
|
|
30
|
+
import '../style/asides.css';
|
|
31
|
+
|
|
32
|
+
// Important that this is the last import so it can override built-in styles.
|
|
33
|
+
import 'virtual:starlight/user-css';
|
|
34
|
+
|
|
35
|
+
const pagefindEnabled =
|
|
36
|
+
Astro.props.entry.slug !== '404' &&
|
|
37
|
+
!Astro.props.entry.slug.endsWith('/404') &&
|
|
38
|
+
Astro.props.entry.data.pagefind !== false;
|
|
39
|
+
---
|
|
40
|
+
|
|
41
|
+
<html
|
|
42
|
+
lang={Astro.props.lang}
|
|
43
|
+
dir={Astro.props.dir}
|
|
44
|
+
data-has-toc={Boolean(Astro.props.toc)}
|
|
45
|
+
data-has-sidebar={Astro.props.hasSidebar}
|
|
46
|
+
data-has-hero={Boolean(Astro.props.entry.data.hero)}
|
|
47
|
+
>
|
|
48
|
+
<head>
|
|
49
|
+
<Head {...Astro.props} />
|
|
50
|
+
<style>
|
|
51
|
+
html:not([data-has-toc]) {
|
|
52
|
+
--sl-mobile-toc-height: 0rem;
|
|
53
|
+
}
|
|
54
|
+
html:not([data-has-sidebar]) {
|
|
55
|
+
--sl-content-width: 67.5rem;
|
|
56
|
+
}
|
|
57
|
+
/* Add scroll padding to ensure anchor headings aren't obscured by nav */
|
|
58
|
+
html {
|
|
59
|
+
/* Additional padding is needed to account for the mobile TOC */
|
|
60
|
+
scroll-padding-top: calc(1.5rem + var(--sl-nav-height) + var(--sl-mobile-toc-height));
|
|
61
|
+
}
|
|
62
|
+
main {
|
|
63
|
+
padding-bottom: 3vh;
|
|
64
|
+
}
|
|
65
|
+
@media (min-width: 50em) {
|
|
66
|
+
[data-has-sidebar] {
|
|
67
|
+
--sl-content-inline-start: var(--sl-sidebar-width);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
@media (min-width: 72em) {
|
|
71
|
+
html {
|
|
72
|
+
scroll-padding-top: calc(1.5rem + var(--sl-nav-height));
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
</style>
|
|
76
|
+
<ThemeProvider {...Astro.props} />
|
|
77
|
+
</head>
|
|
78
|
+
<body>
|
|
79
|
+
<SkipLink {...Astro.props} />
|
|
80
|
+
<PageFrame {...Astro.props}>
|
|
81
|
+
<Header slot="header" {...Astro.props} />
|
|
82
|
+
{Astro.props.hasSidebar && <Sidebar slot="sidebar" {...Astro.props} />}
|
|
83
|
+
<TwoColumnContent {...Astro.props}>
|
|
84
|
+
<PageSidebar slot="right-sidebar" {...Astro.props} />
|
|
85
|
+
<main
|
|
86
|
+
data-pagefind-body={pagefindEnabled}
|
|
87
|
+
lang={Astro.props.entryMeta.lang}
|
|
88
|
+
dir={Astro.props.entryMeta.dir}
|
|
89
|
+
>
|
|
90
|
+
{/* TODO: Revisit how this logic flows. */}
|
|
91
|
+
<Banner {...Astro.props} />
|
|
92
|
+
{
|
|
93
|
+
Astro.props.entry.data.hero ? (
|
|
94
|
+
<ContentPanel {...Astro.props}>
|
|
95
|
+
<Hero {...Astro.props} />
|
|
96
|
+
<MarkdownContent {...Astro.props}>
|
|
97
|
+
<slot />
|
|
98
|
+
</MarkdownContent>
|
|
99
|
+
<Footer {...Astro.props} />
|
|
100
|
+
</ContentPanel>
|
|
101
|
+
) : (
|
|
102
|
+
<>
|
|
103
|
+
<ContentPanel {...Astro.props}>
|
|
104
|
+
<PageTitle {...Astro.props} />
|
|
105
|
+
{Astro.props.isFallback && <FallbackContentNotice {...Astro.props} />}
|
|
106
|
+
</ContentPanel>
|
|
107
|
+
<ContentPanel {...Astro.props}>
|
|
108
|
+
<MarkdownContent {...Astro.props}>
|
|
109
|
+
<slot />
|
|
110
|
+
</MarkdownContent>
|
|
111
|
+
<Footer {...Astro.props} />
|
|
112
|
+
</ContentPanel>
|
|
113
|
+
</>
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
</main>
|
|
117
|
+
</TwoColumnContent>
|
|
118
|
+
</PageFrame>
|
|
119
|
+
</body>
|
|
120
|
+
</html>
|