@umami/shiso 0.35.0 → 0.37.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/dist/index.css +26 -29
- package/dist/index.js +19 -19
- package/dist/index.mjs +36 -26
- package/package.json +2 -2
- package/server/index.d.ts +1 -1
- package/server/index.js +7 -7
package/dist/index.css
CHANGED
|
@@ -1,40 +1,39 @@
|
|
|
1
1
|
/* virtual-css:css:e01d9571088b882a03b91eb2755da783 */
|
|
2
|
-
.
|
|
2
|
+
.PageLinks_links__NmJhO {
|
|
3
3
|
position: sticky;
|
|
4
4
|
top: var(--spacing-8);
|
|
5
5
|
height: max-content;
|
|
6
6
|
min-width: 240px;
|
|
7
7
|
}
|
|
8
|
-
.
|
|
8
|
+
.PageLinks_links__NmJhO a.PageLinks_link__OGI3M {
|
|
9
9
|
display: block;
|
|
10
10
|
color: var(--font-color-muted);
|
|
11
11
|
font-size: var(--font-size);
|
|
12
|
-
text-wrap: nowrap;
|
|
13
12
|
text-decoration: none;
|
|
14
13
|
}
|
|
15
|
-
.
|
|
14
|
+
.PageLinks_links__NmJhO a.PageLinks_link__OGI3M:hover {
|
|
16
15
|
color: var(--primary-color);
|
|
17
16
|
text-decoration: none;
|
|
18
17
|
}
|
|
19
|
-
.PageLinks_indent-
|
|
18
|
+
.PageLinks_indent-1__M2IxZ {
|
|
20
19
|
margin-left: 0;
|
|
21
20
|
}
|
|
22
|
-
.PageLinks_indent-
|
|
21
|
+
.PageLinks_indent-2__YTBlM {
|
|
23
22
|
margin-left: 0;
|
|
24
23
|
}
|
|
25
|
-
.PageLinks_indent-
|
|
24
|
+
.PageLinks_indent-3__YzJlZ {
|
|
26
25
|
margin-left: 10px;
|
|
27
26
|
}
|
|
28
|
-
.PageLinks_indent-
|
|
27
|
+
.PageLinks_indent-4__NDg3Z {
|
|
29
28
|
margin-left: 20px;
|
|
30
29
|
}
|
|
31
|
-
.PageLinks_indent-
|
|
30
|
+
.PageLinks_indent-5__ZTE4M {
|
|
32
31
|
margin-left: 30px;
|
|
33
32
|
}
|
|
34
|
-
.PageLinks_indent-
|
|
33
|
+
.PageLinks_indent-6__NTRjM {
|
|
35
34
|
margin-left: 40px;
|
|
36
35
|
}
|
|
37
|
-
.
|
|
36
|
+
.PageLinks_links__NmJhO a.PageLinks_selected__ZjhkN {
|
|
38
37
|
color: var(--primary-color);
|
|
39
38
|
}
|
|
40
39
|
|
|
@@ -73,62 +72,60 @@ pre.CodeBlock_container__ZTkxY code {
|
|
|
73
72
|
}
|
|
74
73
|
|
|
75
74
|
/* virtual-css:css:62c31e195181c97259fa56b13d20ea6d */
|
|
76
|
-
.
|
|
75
|
+
.SideNav_nav__OWYwN {
|
|
77
76
|
overflow-y: auto;
|
|
78
77
|
min-width: 240px;
|
|
79
78
|
}
|
|
80
|
-
.
|
|
79
|
+
.SideNav_nav__OWYwN::-webkit-scrollbar {
|
|
81
80
|
width: 15px;
|
|
82
81
|
background: transparent;
|
|
83
82
|
display: none;
|
|
84
83
|
}
|
|
85
|
-
.
|
|
84
|
+
.SideNav_nav__OWYwN:hover::-webkit-scrollbar {
|
|
86
85
|
display: block;
|
|
87
86
|
}
|
|
88
|
-
.
|
|
87
|
+
.SideNav_nav__OWYwN::-webkit-scrollbar-track {
|
|
89
88
|
border: 7px solid rgba(0, 0, 0, 0);
|
|
90
89
|
background-color: var(--border-color);
|
|
91
90
|
background-clip: padding-box;
|
|
92
91
|
}
|
|
93
|
-
.
|
|
92
|
+
.SideNav_nav__OWYwN::-webkit-scrollbar-thumb {
|
|
94
93
|
border: 7px solid rgba(0, 0, 0, 0);
|
|
95
94
|
background-color: var(--primary-color);
|
|
96
95
|
background-clip: padding-box;
|
|
97
96
|
}
|
|
98
|
-
.
|
|
97
|
+
.SideNav_nav__OWYwN::-webkit-scrollbar-thumb:hover {
|
|
99
98
|
border: 5px solid rgba(0, 0, 0, 0);
|
|
100
99
|
background-color: var(--primary-color);
|
|
101
100
|
background-clip: padding-box;
|
|
102
101
|
}
|
|
103
|
-
.
|
|
102
|
+
.SideNav_nav__OWYwN.SideNav_sticky__OGNhY {
|
|
104
103
|
position: sticky;
|
|
105
104
|
top: var(--spacing-8);
|
|
106
105
|
}
|
|
107
|
-
.
|
|
106
|
+
.SideNav_nav__OWYwN .SideNav_item__NTA5Z {
|
|
108
107
|
color: var(--font-color-muted);
|
|
109
|
-
padding: 0;
|
|
110
108
|
border-radius: 0;
|
|
109
|
+
border-left: 1px solid var(--border-color);
|
|
110
|
+
outline: none;
|
|
111
111
|
}
|
|
112
|
-
.
|
|
112
|
+
.SideNav_nav__OWYwN .SideNav_item__NTA5Z a {
|
|
113
113
|
color: currentColor;
|
|
114
114
|
width: 100%;
|
|
115
115
|
padding: var(--padding-y) var(--padding-x);
|
|
116
116
|
text-decoration: none;
|
|
117
117
|
}
|
|
118
|
-
.
|
|
118
|
+
.SideNav_nav__OWYwN .SideNav_item__NTA5Z a:hover {
|
|
119
119
|
color: var(--primary-color);
|
|
120
120
|
}
|
|
121
|
-
.
|
|
121
|
+
.SideNav_nav__OWYwN .SideNav_item__NTA5Z.SideNav_selected__NWU1Y {
|
|
122
122
|
color: var(--font-color);
|
|
123
|
-
font-weight:
|
|
123
|
+
font-weight: 500;
|
|
124
124
|
border-color: var(--primary-color);
|
|
125
125
|
background-color: var(--highlight-color);
|
|
126
|
+
border-left: 1px solid var(--primary-color);
|
|
126
127
|
}
|
|
127
|
-
.
|
|
128
|
-
display: grid;
|
|
129
|
-
gap: var(--spacing-1);
|
|
130
|
-
}
|
|
131
|
-
.SideNav_items__ZWU5O header {
|
|
128
|
+
.SideNav_items__YjBjM header {
|
|
132
129
|
padding: var(--padding-y) 0;
|
|
133
130
|
}
|
|
134
131
|
|
package/dist/index.js
CHANGED
|
@@ -49,7 +49,7 @@ var import_react_zen = require("@umami/react-zen");
|
|
|
49
49
|
var import_classnames = __toESM(require("classnames"));
|
|
50
50
|
|
|
51
51
|
// css-modules:E:\dev\umami-shiso\src\components\PageLinks.module.css
|
|
52
|
-
var PageLinks_default = { "links": "
|
|
52
|
+
var PageLinks_default = { "links": "PageLinks_links__NmJhO", "link": "PageLinks_link__OGI3M", "indent-1": "PageLinks_indent-1__M2IxZ", "indent-2": "PageLinks_indent-2__YTBlM", "indent-3": "PageLinks_indent-3__YzJlZ", "indent-4": "PageLinks_indent-4__NDg3Z", "indent-5": "PageLinks_indent-5__ZTE4M", "indent-6": "PageLinks_indent-6__NTRjM", "selected": "PageLinks_selected__ZjhkN" };
|
|
53
53
|
|
|
54
54
|
// src/components/PageLinks.tsx
|
|
55
55
|
var import_jsx_runtime = require("react/jsx-runtime");
|
|
@@ -130,10 +130,9 @@ var import_react3 = require("react");
|
|
|
130
130
|
var import_react_zen3 = require("@umami/react-zen");
|
|
131
131
|
var import_classnames2 = __toESM(require("classnames"));
|
|
132
132
|
var import_navigation = require("next/navigation");
|
|
133
|
-
var import_link = __toESM(require("next/link"));
|
|
134
133
|
|
|
135
134
|
// css-modules:E:\dev\umami-shiso\src\components\SideNav.module.css
|
|
136
|
-
var SideNav_default = { "nav": "
|
|
135
|
+
var SideNav_default = { "nav": "SideNav_nav__OWYwN", "sticky": "SideNav_sticky__OGNhY", "item": "SideNav_item__NTA5Z", "selected": "SideNav_selected__NWU1Y", "items": "SideNav_items__YjBjM" };
|
|
137
136
|
|
|
138
137
|
// src/components/SideNav.tsx
|
|
139
138
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -159,7 +158,7 @@ function SideNav({
|
|
|
159
158
|
}
|
|
160
159
|
}, [autoHeight]);
|
|
161
160
|
return /* @__PURE__ */ (0, import_jsx_runtime3.jsx)(
|
|
162
|
-
import_react_zen3.
|
|
161
|
+
import_react_zen3.Column,
|
|
163
162
|
{
|
|
164
163
|
...props,
|
|
165
164
|
id: "shiso_docs_sidenav",
|
|
@@ -173,7 +172,8 @@ function SideNav({
|
|
|
173
172
|
className: (0, import_classnames2.default)(SideNav_default.item, {
|
|
174
173
|
[SideNav_default.selected]: url === pathname
|
|
175
174
|
}),
|
|
176
|
-
|
|
175
|
+
href: url,
|
|
176
|
+
children: text
|
|
177
177
|
},
|
|
178
178
|
index
|
|
179
179
|
);
|
|
@@ -184,7 +184,6 @@ function SideNav({
|
|
|
184
184
|
}
|
|
185
185
|
|
|
186
186
|
// src/components/TopNav.tsx
|
|
187
|
-
var import_link2 = __toESM(require("next/link"));
|
|
188
187
|
var import_navigation2 = require("next/navigation");
|
|
189
188
|
var import_react_zen4 = require("@umami/react-zen");
|
|
190
189
|
var import_jsx_runtime4 = require("react/jsx-runtime");
|
|
@@ -193,13 +192,13 @@ function TopNav({ tabs }) {
|
|
|
193
192
|
const tab = tabs?.find(({ id, url }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
194
193
|
const selected = tab?.id || "docs";
|
|
195
194
|
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_zen4.Tabs, { selectedKey: selected, children: /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_zen4.TabList, { items: tabs, children: ({ id, label, url }) => {
|
|
196
|
-
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_zen4.Tab, { id,
|
|
195
|
+
return /* @__PURE__ */ (0, import_jsx_runtime4.jsx)(import_react_zen4.Tab, { id, href: url, children: label });
|
|
197
196
|
} }) });
|
|
198
197
|
}
|
|
199
198
|
|
|
200
199
|
// src/components/DocContent.tsx
|
|
201
200
|
var import_react_zen6 = require("@umami/react-zen");
|
|
202
|
-
var
|
|
201
|
+
var import_link = __toESM(require("next/link"));
|
|
203
202
|
|
|
204
203
|
// src/components/Markdown.tsx
|
|
205
204
|
var import_react_zen5 = require("@umami/react-zen");
|
|
@@ -261,7 +260,7 @@ var NavigationButton = ({
|
|
|
261
260
|
if (!url || !label) {
|
|
262
261
|
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Box, {});
|
|
263
262
|
}
|
|
264
|
-
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(
|
|
263
|
+
return /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_link.default, { href: url, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsxs)(import_react_zen6.Row, { alignItems: "center", gap: "3", marginY: "3", children: [
|
|
265
264
|
isPrev && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Icon, { size: "sm", rotate: 180, children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Icons.Chevron, {}) }),
|
|
266
265
|
/* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Text, { size: "3", weight: "bold", children: label }),
|
|
267
266
|
!isPrev && /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Icon, { size: "sm", children: /* @__PURE__ */ (0, import_jsx_runtime6.jsx)(import_react_zen6.Icons.Chevron, {}) })
|
|
@@ -279,7 +278,7 @@ function parseContent(content, config = {}) {
|
|
|
279
278
|
const groups = navigation[key];
|
|
280
279
|
found = groups?.find((group, groupIndex) => {
|
|
281
280
|
return group.pages.find((page, pageIndex) => {
|
|
282
|
-
const match = page.url.endsWith(content.slug);
|
|
281
|
+
const match = page.url.endsWith(content.slug) || content.slug === "index" && content.path.endsWith("index.mdx");
|
|
283
282
|
if (match) {
|
|
284
283
|
const prevGroup = groups[groupIndex - 1];
|
|
285
284
|
const nextGroup = groups[groupIndex + 1];
|
|
@@ -292,7 +291,6 @@ function parseContent(content, config = {}) {
|
|
|
292
291
|
});
|
|
293
292
|
}
|
|
294
293
|
});
|
|
295
|
-
console.log({ content, tabs, navigation, section, next, prev });
|
|
296
294
|
return { ...content, tabs, navigation, section, next, prev };
|
|
297
295
|
}
|
|
298
296
|
function Docs({ content, config }) {
|
|
@@ -372,20 +370,22 @@ var import_react_zen9 = require("@umami/react-zen");
|
|
|
372
370
|
|
|
373
371
|
// src/components/Card.tsx
|
|
374
372
|
var import_react_zen8 = require("@umami/react-zen");
|
|
375
|
-
var
|
|
373
|
+
var import_link2 = __toESM(require("next/link"));
|
|
376
374
|
var import_date_fns = require("date-fns");
|
|
377
375
|
var import_jsx_runtime8 = require("react/jsx-runtime");
|
|
378
376
|
function Card({ title, description, date, author, url, image }) {
|
|
379
377
|
return /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_zen8.Column, { borderSize: "1", borderRadius: "3", overflow: "hidden", children: [
|
|
380
378
|
image && /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Box, { height: "240px", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Image, { src: image, alt: title, objectFit: "cover" }) }),
|
|
381
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_zen8.Column, { padding: "6", gap: "4", children: [
|
|
382
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
383
|
-
|
|
384
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.
|
|
385
|
-
|
|
379
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_zen8.Column, { padding: "6", gap: "4", flexGrow: 1, children: [
|
|
380
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_zen8.Column, { gap: "4", flexGrow: 1, children: [
|
|
381
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Heading, { size: "4", as: "header", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_link2.default, { href: url, children: title }) }),
|
|
382
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_react_zen8.Row, { justifyContent: "space-between", children: [
|
|
383
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Text, { color: "muted", children: date && (0, import_date_fns.format)(new Date(date), "PP") }),
|
|
384
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Text, { color: "muted", children: author })
|
|
385
|
+
] }),
|
|
386
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Box, { marginY: "5", as: "p", children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Text, { size: "3", children: description }) })
|
|
386
387
|
] }),
|
|
387
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.
|
|
388
|
-
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Button, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_link4.default, { href: url, children: [
|
|
388
|
+
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Button, { asChild: true, children: /* @__PURE__ */ (0, import_jsx_runtime8.jsxs)(import_link2.default, { href: url, children: [
|
|
389
389
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Text, { children: "Read more" }),
|
|
390
390
|
/* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Icon, { children: /* @__PURE__ */ (0, import_jsx_runtime8.jsx)(import_react_zen8.Icons.Arrow, {}) })
|
|
391
391
|
] }) })
|
package/dist/index.mjs
CHANGED
|
@@ -5,7 +5,7 @@ import "@umami/react-zen/styles.css";
|
|
|
5
5
|
import "highlight.js/styles/github-dark.css";
|
|
6
6
|
|
|
7
7
|
// src/components/Blog.tsx
|
|
8
|
-
import { Heading as Heading5, Box as Box8, Text as Text5, Row as Row5, Column as
|
|
8
|
+
import { Heading as Heading5, Box as Box8, Text as Text5, Row as Row5, Column as Column5, Image as Image2 } from "@umami/react-zen";
|
|
9
9
|
import { format as format2 } from "date-fns";
|
|
10
10
|
|
|
11
11
|
// src/components/PageLinks.tsx
|
|
@@ -14,7 +14,7 @@ import { Column, Text, Box } from "@umami/react-zen";
|
|
|
14
14
|
import classNames from "classnames";
|
|
15
15
|
|
|
16
16
|
// css-modules:E:\dev\umami-shiso\src\components\PageLinks.module.css
|
|
17
|
-
var PageLinks_default = { "links": "
|
|
17
|
+
var PageLinks_default = { "links": "PageLinks_links__NmJhO", "link": "PageLinks_link__OGI3M", "indent-1": "PageLinks_indent-1__M2IxZ", "indent-2": "PageLinks_indent-2__YTBlM", "indent-3": "PageLinks_indent-3__YzJlZ", "indent-4": "PageLinks_indent-4__NDg3Z", "indent-5": "PageLinks_indent-5__ZTE4M", "indent-6": "PageLinks_indent-6__NTRjM", "selected": "PageLinks_selected__ZjhkN" };
|
|
18
18
|
|
|
19
19
|
// src/components/PageLinks.tsx
|
|
20
20
|
import { jsx, jsxs } from "react/jsx-runtime";
|
|
@@ -103,13 +103,12 @@ import {
|
|
|
103
103
|
|
|
104
104
|
// src/components/SideNav.tsx
|
|
105
105
|
import { useEffect as useEffect2, useState as useState3 } from "react";
|
|
106
|
-
import {
|
|
106
|
+
import { Column as Column2, List, ListItem, ListSection } from "@umami/react-zen";
|
|
107
107
|
import classNames2 from "classnames";
|
|
108
108
|
import { usePathname } from "next/navigation";
|
|
109
|
-
import Link from "next/link";
|
|
110
109
|
|
|
111
110
|
// css-modules:E:\dev\umami-shiso\src\components\SideNav.module.css
|
|
112
|
-
var SideNav_default = { "nav": "
|
|
111
|
+
var SideNav_default = { "nav": "SideNav_nav__OWYwN", "sticky": "SideNav_sticky__OGNhY", "item": "SideNav_item__NTA5Z", "selected": "SideNav_selected__NWU1Y", "items": "SideNav_items__YjBjM" };
|
|
113
112
|
|
|
114
113
|
// src/components/SideNav.tsx
|
|
115
114
|
import { jsx as jsx3 } from "react/jsx-runtime";
|
|
@@ -135,7 +134,7 @@ function SideNav({
|
|
|
135
134
|
}
|
|
136
135
|
}, [autoHeight]);
|
|
137
136
|
return /* @__PURE__ */ jsx3(
|
|
138
|
-
|
|
137
|
+
Column2,
|
|
139
138
|
{
|
|
140
139
|
...props,
|
|
141
140
|
id: "shiso_docs_sidenav",
|
|
@@ -149,7 +148,8 @@ function SideNav({
|
|
|
149
148
|
className: classNames2(SideNav_default.item, {
|
|
150
149
|
[SideNav_default.selected]: url === pathname
|
|
151
150
|
}),
|
|
152
|
-
|
|
151
|
+
href: url,
|
|
152
|
+
children: text
|
|
153
153
|
},
|
|
154
154
|
index
|
|
155
155
|
);
|
|
@@ -160,7 +160,6 @@ function SideNav({
|
|
|
160
160
|
}
|
|
161
161
|
|
|
162
162
|
// src/components/TopNav.tsx
|
|
163
|
-
import Link2 from "next/link";
|
|
164
163
|
import { usePathname as usePathname2 } from "next/navigation";
|
|
165
164
|
import { Tabs, TabList, Tab } from "@umami/react-zen";
|
|
166
165
|
import { jsx as jsx4 } from "react/jsx-runtime";
|
|
@@ -169,13 +168,13 @@ function TopNav({ tabs }) {
|
|
|
169
168
|
const tab = tabs?.find(({ id, url }) => id !== "docs" ? pathname.startsWith(url) : false);
|
|
170
169
|
const selected = tab?.id || "docs";
|
|
171
170
|
return /* @__PURE__ */ jsx4(Tabs, { selectedKey: selected, children: /* @__PURE__ */ jsx4(TabList, { items: tabs, children: ({ id, label, url }) => {
|
|
172
|
-
return /* @__PURE__ */ jsx4(Tab, { id,
|
|
171
|
+
return /* @__PURE__ */ jsx4(Tab, { id, href: url, children: label });
|
|
173
172
|
} }) });
|
|
174
173
|
}
|
|
175
174
|
|
|
176
175
|
// src/components/DocContent.tsx
|
|
177
176
|
import { Heading, Box as Box4, Text as Text2, Row, Icon as Icon2, Icons as Icons2 } from "@umami/react-zen";
|
|
178
|
-
import
|
|
177
|
+
import Link from "next/link";
|
|
179
178
|
|
|
180
179
|
// src/components/Markdown.tsx
|
|
181
180
|
import { Box as Box3 } from "@umami/react-zen";
|
|
@@ -236,7 +235,7 @@ var NavigationButton = ({
|
|
|
236
235
|
if (!url || !label) {
|
|
237
236
|
return /* @__PURE__ */ jsx6(Box4, {});
|
|
238
237
|
}
|
|
239
|
-
return /* @__PURE__ */ jsx6(
|
|
238
|
+
return /* @__PURE__ */ jsx6(Link, { href: url, children: /* @__PURE__ */ jsxs4(Row, { alignItems: "center", gap: "3", marginY: "3", children: [
|
|
240
239
|
isPrev && /* @__PURE__ */ jsx6(Icon2, { size: "sm", rotate: 180, children: /* @__PURE__ */ jsx6(Icons2.Chevron, {}) }),
|
|
241
240
|
/* @__PURE__ */ jsx6(Text2, { size: "3", weight: "bold", children: label }),
|
|
242
241
|
!isPrev && /* @__PURE__ */ jsx6(Icon2, { size: "sm", children: /* @__PURE__ */ jsx6(Icons2.Chevron, {}) })
|
|
@@ -254,7 +253,7 @@ function parseContent(content, config = {}) {
|
|
|
254
253
|
const groups = navigation[key];
|
|
255
254
|
found = groups?.find((group, groupIndex) => {
|
|
256
255
|
return group.pages.find((page, pageIndex) => {
|
|
257
|
-
const match = page.url.endsWith(content.slug);
|
|
256
|
+
const match = page.url.endsWith(content.slug) || content.slug === "index" && content.path.endsWith("index.mdx");
|
|
258
257
|
if (match) {
|
|
259
258
|
const prevGroup = groups[groupIndex - 1];
|
|
260
259
|
const nextGroup = groups[groupIndex + 1];
|
|
@@ -267,7 +266,6 @@ function parseContent(content, config = {}) {
|
|
|
267
266
|
});
|
|
268
267
|
}
|
|
269
268
|
});
|
|
270
|
-
console.log({ content, tabs, navigation, section, next, prev });
|
|
271
269
|
return { ...content, tabs, navigation, section, next, prev };
|
|
272
270
|
}
|
|
273
271
|
function Docs({ content, config }) {
|
|
@@ -343,24 +341,36 @@ function Docs({ content, config }) {
|
|
|
343
341
|
}
|
|
344
342
|
|
|
345
343
|
// src/components/Blogs.tsx
|
|
346
|
-
import { Grid } from "@umami/react-zen";
|
|
344
|
+
import { Grid as Grid2 } from "@umami/react-zen";
|
|
347
345
|
|
|
348
346
|
// src/components/Card.tsx
|
|
349
|
-
import {
|
|
350
|
-
|
|
347
|
+
import {
|
|
348
|
+
Box as Box6,
|
|
349
|
+
Image,
|
|
350
|
+
Column as Column3,
|
|
351
|
+
Row as Row3,
|
|
352
|
+
Heading as Heading3,
|
|
353
|
+
Text as Text4,
|
|
354
|
+
Button as Button2,
|
|
355
|
+
Icon as Icon4,
|
|
356
|
+
Icons as Icons4
|
|
357
|
+
} from "@umami/react-zen";
|
|
358
|
+
import Link2 from "next/link";
|
|
351
359
|
import { format } from "date-fns";
|
|
352
360
|
import { jsx as jsx8, jsxs as jsxs6 } from "react/jsx-runtime";
|
|
353
361
|
function Card({ title, description, date, author, url, image }) {
|
|
354
|
-
return /* @__PURE__ */ jsxs6(
|
|
362
|
+
return /* @__PURE__ */ jsxs6(Column3, { borderSize: "1", borderRadius: "3", overflow: "hidden", children: [
|
|
355
363
|
image && /* @__PURE__ */ jsx8(Box6, { height: "240px", children: /* @__PURE__ */ jsx8(Image, { src: image, alt: title, objectFit: "cover" }) }),
|
|
356
|
-
/* @__PURE__ */ jsxs6(
|
|
357
|
-
/* @__PURE__ */
|
|
358
|
-
|
|
359
|
-
/* @__PURE__ */
|
|
360
|
-
|
|
364
|
+
/* @__PURE__ */ jsxs6(Column3, { padding: "6", gap: "4", flexGrow: 1, children: [
|
|
365
|
+
/* @__PURE__ */ jsxs6(Column3, { gap: "4", flexGrow: 1, children: [
|
|
366
|
+
/* @__PURE__ */ jsx8(Heading3, { size: "4", as: "header", children: /* @__PURE__ */ jsx8(Link2, { href: url, children: title }) }),
|
|
367
|
+
/* @__PURE__ */ jsxs6(Row3, { justifyContent: "space-between", children: [
|
|
368
|
+
/* @__PURE__ */ jsx8(Text4, { color: "muted", children: date && format(new Date(date), "PP") }),
|
|
369
|
+
/* @__PURE__ */ jsx8(Text4, { color: "muted", children: author })
|
|
370
|
+
] }),
|
|
371
|
+
/* @__PURE__ */ jsx8(Box6, { marginY: "5", as: "p", children: /* @__PURE__ */ jsx8(Text4, { size: "3", children: description }) })
|
|
361
372
|
] }),
|
|
362
|
-
/* @__PURE__ */ jsx8(
|
|
363
|
-
/* @__PURE__ */ jsx8(Button2, { asChild: true, children: /* @__PURE__ */ jsxs6(Link4, { href: url, children: [
|
|
373
|
+
/* @__PURE__ */ jsx8(Button2, { asChild: true, children: /* @__PURE__ */ jsxs6(Link2, { href: url, children: [
|
|
364
374
|
/* @__PURE__ */ jsx8(Text4, { children: "Read more" }),
|
|
365
375
|
/* @__PURE__ */ jsx8(Icon4, { children: /* @__PURE__ */ jsx8(Icons4.Arrow, {}) })
|
|
366
376
|
] }) })
|
|
@@ -376,7 +386,7 @@ function Blogs({ content, config }) {
|
|
|
376
386
|
return /* @__PURE__ */ jsx9(Blog, { ...meta, code, anchors });
|
|
377
387
|
}
|
|
378
388
|
console.log({ content });
|
|
379
|
-
return /* @__PURE__ */ jsx9(
|
|
389
|
+
return /* @__PURE__ */ jsx9(Grid2, { gap: "5", columns: "repeat(auto-fit, minmax(400px, 1fr)", children: content?.sort((a, b) => new Date(b.meta.date).getTime() - new Date(a.meta.date).getTime()).map(({ meta, slug }) => /* @__PURE__ */ jsx9(Card, { url: `/blog/${slug}`, ...meta }, slug)) });
|
|
380
390
|
}
|
|
381
391
|
|
|
382
392
|
// src/components/Shiso.tsx
|
|
@@ -413,7 +423,7 @@ function Blog({ title, code, author, date, image, anchors }) {
|
|
|
413
423
|
lg: "block",
|
|
414
424
|
xl: "block"
|
|
415
425
|
};
|
|
416
|
-
return /* @__PURE__ */ jsxs7(
|
|
426
|
+
return /* @__PURE__ */ jsxs7(Column5, { gap: "8", maxWidth: "900px", style: { margin: "0 auto" }, children: [
|
|
417
427
|
/* @__PURE__ */ jsx11(Box8, { flexGrow: 1, children: title && /* @__PURE__ */ jsx11(Heading5, { size: "1", as: "h1", align: "center", children: title }) }),
|
|
418
428
|
image && /* @__PURE__ */ jsx11(Box8, { height: "480px", children: /* @__PURE__ */ jsx11(Image2, { src: image, alt: title, objectFit: "cover", borderRadius: "3" }) }),
|
|
419
429
|
/* @__PURE__ */ jsxs7(Row5, { justifyContent: "space-between", children: [
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@umami/shiso",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.37.0",
|
|
4
4
|
"description": "A content layer for Next.js",
|
|
5
5
|
"homepage": "https://umami.is/shiso",
|
|
6
6
|
"repository": {
|
|
@@ -46,7 +46,7 @@
|
|
|
46
46
|
"@mdx-js/loader": "^3.0.0",
|
|
47
47
|
"@mdx-js/mdx": "^3.1.0",
|
|
48
48
|
"@mdx-js/react": "^3.0.0",
|
|
49
|
-
"@umami/react-zen": "^0.
|
|
49
|
+
"@umami/react-zen": "^0.43.0",
|
|
50
50
|
"classnames": "^2.5.1",
|
|
51
51
|
"date-fns": "^4.1.0",
|
|
52
52
|
"glob": "^10.3.10",
|
package/server/index.d.ts
CHANGED
package/server/index.js
CHANGED
|
@@ -87,7 +87,7 @@ export var parseFile = cache(function (file) { return __awaiter(void 0, void 0,
|
|
|
87
87
|
}); });
|
|
88
88
|
export function next(type, config) {
|
|
89
89
|
var _this = this;
|
|
90
|
-
var dir = path.
|
|
90
|
+
var dir = path.resolve(config.contentDir, type);
|
|
91
91
|
var _a = config[type].title, title = _a === void 0 ? 'Shiso' : _a;
|
|
92
92
|
var getContent = function (file) { return __awaiter(_this, void 0, void 0, function () {
|
|
93
93
|
var content;
|
|
@@ -106,20 +106,20 @@ export function next(type, config) {
|
|
|
106
106
|
function generateMetadata(_a) {
|
|
107
107
|
return __awaiter(this, arguments, void 0, function (_b) {
|
|
108
108
|
var name, file, content;
|
|
109
|
-
var _c, _d, _e;
|
|
109
|
+
var _c, _d, _e, _f;
|
|
110
110
|
var params = _b.params;
|
|
111
|
-
return __generator(this, function (
|
|
112
|
-
switch (
|
|
111
|
+
return __generator(this, function (_g) {
|
|
112
|
+
switch (_g.label) {
|
|
113
113
|
case 0: return [4 /*yield*/, params];
|
|
114
114
|
case 1:
|
|
115
|
-
name = ((_d = (_c = (
|
|
115
|
+
name = ((_d = (_c = (_g.sent())) === null || _c === void 0 ? void 0 : _c.slug) === null || _d === void 0 ? void 0 : _d.join('/')) || 'index';
|
|
116
116
|
file = path.join(dir, "".concat(name, ".mdx"));
|
|
117
117
|
return [4 /*yield*/, getContent(file)];
|
|
118
118
|
case 2:
|
|
119
|
-
content =
|
|
119
|
+
content = _g.sent();
|
|
120
120
|
return [2 /*return*/, {
|
|
121
121
|
title: {
|
|
122
|
-
absolute: "".concat((
|
|
122
|
+
absolute: ((_e = content === null || content === void 0 ? void 0 : content.meta) === null || _e === void 0 ? void 0 : _e.title) ? "".concat((_f = content === null || content === void 0 ? void 0 : content.meta) === null || _f === void 0 ? void 0 : _f.title, " \u2013 ").concat(title) : title,
|
|
123
123
|
default: title,
|
|
124
124
|
},
|
|
125
125
|
}];
|