@myst-theme/site 1.3.0 → 1.3.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@myst-theme/site",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./src/index.ts",
|
|
6
6
|
"types": "./src/index.ts",
|
|
@@ -25,11 +25,11 @@
|
|
|
25
25
|
"dependencies": {
|
|
26
26
|
"@headlessui/react": "^1.7.15",
|
|
27
27
|
"@heroicons/react": "^2.0.18",
|
|
28
|
-
"@myst-theme/common": "^1.3.
|
|
29
|
-
"@myst-theme/diagrams": "^1.3.
|
|
30
|
-
"@myst-theme/frontmatter": "^1.3.
|
|
31
|
-
"@myst-theme/providers": "^1.3.
|
|
32
|
-
"@myst-theme/search": "^1.3.
|
|
28
|
+
"@myst-theme/common": "^1.3.1",
|
|
29
|
+
"@myst-theme/diagrams": "^1.3.1",
|
|
30
|
+
"@myst-theme/frontmatter": "^1.3.1",
|
|
31
|
+
"@myst-theme/providers": "^1.3.1",
|
|
32
|
+
"@myst-theme/search": "^1.3.1",
|
|
33
33
|
"@radix-ui/react-collapsible": "^1.0.3",
|
|
34
34
|
"@radix-ui/react-dialog": "^1.0.3",
|
|
35
35
|
"@radix-ui/react-visually-hidden": "^1.1.0",
|
|
@@ -37,9 +37,9 @@
|
|
|
37
37
|
"lodash.throttle": "^4.1.1",
|
|
38
38
|
"myst-common": "^1.8.1",
|
|
39
39
|
"myst-config": "^1.7.9",
|
|
40
|
-
"myst-demo": "^1.3.
|
|
40
|
+
"myst-demo": "^1.3.1",
|
|
41
41
|
"myst-spec-ext": "^1.8.1",
|
|
42
|
-
"myst-to-react": "^1.3.
|
|
42
|
+
"myst-to-react": "^1.3.1",
|
|
43
43
|
"nbtx": "^0.2.3",
|
|
44
44
|
"node-cache": "^5.1.2",
|
|
45
45
|
"node-fetch": "^2.6.11",
|
|
@@ -44,13 +44,19 @@ function nestToc(toc: Heading[]): NestedHeading[] {
|
|
|
44
44
|
}
|
|
45
45
|
|
|
46
46
|
function pathnameMatchesHeading(pathname: string, heading: Heading, baseurl?: string) {
|
|
47
|
-
|
|
48
|
-
//
|
|
49
|
-
//
|
|
50
|
-
//
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
47
|
+
// Normalize `pathname` to be comparable to the unprefixed `heading.path`.
|
|
48
|
+
//
|
|
49
|
+
// During SSR in `myst build --html` static builds, `useLocation().pathname`
|
|
50
|
+
// does not include the site's `baseurl`; on the client it does (Remix does
|
|
51
|
+
// not strip the basename here).
|
|
52
|
+
//
|
|
53
|
+
// Also strip any trailing slash, since static builds end up with one and
|
|
54
|
+
// `heading.path` is slashless.
|
|
55
|
+
let normed = pathname.endsWith('/') ? pathname.slice(0, -1) : pathname;
|
|
56
|
+
if (baseurl && normed.startsWith(baseurl)) normed = normed.slice(baseurl.length);
|
|
57
|
+
const headingPath = heading.path;
|
|
58
|
+
if (normed && headingPath === `${normed}/index`) return true;
|
|
59
|
+
return headingPath === normed;
|
|
54
60
|
}
|
|
55
61
|
|
|
56
62
|
function childrenOpen(headings: NestedHeading[], pathname: string, baseurl?: string): string[] {
|
package/src/pages/Root.tsx
CHANGED
|
@@ -142,7 +142,7 @@ export function DocumentWithoutProviders({
|
|
|
142
142
|
/>
|
|
143
143
|
{head}
|
|
144
144
|
</head>
|
|
145
|
-
<body className="m-0
|
|
145
|
+
<body className="m-0 bg-white dark:bg-stone-900">
|
|
146
146
|
<BaseUrlProvider baseurl={baseurl}>
|
|
147
147
|
<SiteProvider config={config}>{children}</SiteProvider>
|
|
148
148
|
</BaseUrlProvider>
|