@nexpress/theme-docs 0.3.7 → 0.3.8
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.d.ts +6 -2
- package/dist/index.js +375 -72
- package/dist/index.js.map +1 -1
- package/package.json +6 -6
package/dist/index.js
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
1
|
// src/index.ts
|
|
2
|
-
import {
|
|
3
|
-
defineTheme
|
|
4
|
-
} from "@nexpress/theme";
|
|
2
|
+
import { defineTheme } from "@nexpress/theme";
|
|
5
3
|
|
|
6
4
|
// src/copy-button-bridge.ts
|
|
7
5
|
import { CopyButton } from "./components/copy-button.js";
|
|
@@ -1070,6 +1068,140 @@ var docsCss = `
|
|
|
1070
1068
|
font-family: var(--np-font-mono, "Geist Mono", ui-monospace, SFMono-Regular, Menlo, monospace);
|
|
1071
1069
|
}
|
|
1072
1070
|
|
|
1071
|
+
.np-docs-api,
|
|
1072
|
+
.np-docs-changelog-page {
|
|
1073
|
+
max-width: 980px;
|
|
1074
|
+
margin: 0 auto;
|
|
1075
|
+
padding: 3rem 1rem 5rem;
|
|
1076
|
+
}
|
|
1077
|
+
.np-docs-api-hero,
|
|
1078
|
+
.np-docs-changelog-hero {
|
|
1079
|
+
padding: 3rem 0 2rem;
|
|
1080
|
+
}
|
|
1081
|
+
.np-docs-api-eyebrow,
|
|
1082
|
+
.np-docs-changelog-hero p {
|
|
1083
|
+
margin: 0 0 0.8rem;
|
|
1084
|
+
font-family: var(--np-font-mono);
|
|
1085
|
+
color: var(--np-color-primary);
|
|
1086
|
+
font-size: 0.78rem;
|
|
1087
|
+
letter-spacing: 0.08em;
|
|
1088
|
+
text-transform: uppercase;
|
|
1089
|
+
}
|
|
1090
|
+
.np-docs-api-hero h1,
|
|
1091
|
+
.np-docs-changelog-hero h1 {
|
|
1092
|
+
margin: 0;
|
|
1093
|
+
font-size: clamp(2.4rem, 5vw, 4.4rem);
|
|
1094
|
+
line-height: 1;
|
|
1095
|
+
letter-spacing: -0.04em;
|
|
1096
|
+
}
|
|
1097
|
+
.np-docs-api-hero p,
|
|
1098
|
+
.np-docs-changelog-hero span {
|
|
1099
|
+
display: block;
|
|
1100
|
+
max-width: 44rem;
|
|
1101
|
+
margin-top: 1rem;
|
|
1102
|
+
color: var(--np-color-muted-foreground);
|
|
1103
|
+
font-size: 1.05rem;
|
|
1104
|
+
}
|
|
1105
|
+
.np-docs-api-signature {
|
|
1106
|
+
overflow: hidden;
|
|
1107
|
+
border: 1px solid var(--np-color-border);
|
|
1108
|
+
border-radius: 14px;
|
|
1109
|
+
background: #0b1220;
|
|
1110
|
+
color: #e6edf6;
|
|
1111
|
+
}
|
|
1112
|
+
.np-docs-api-signature-head {
|
|
1113
|
+
display: flex;
|
|
1114
|
+
justify-content: space-between;
|
|
1115
|
+
gap: 1rem;
|
|
1116
|
+
padding: 0.8rem 1rem;
|
|
1117
|
+
color: #93c5fd;
|
|
1118
|
+
border-bottom: 1px solid rgba(255,255,255,0.12);
|
|
1119
|
+
font-family: var(--np-font-mono);
|
|
1120
|
+
font-size: 0.78rem;
|
|
1121
|
+
}
|
|
1122
|
+
.np-docs-api-signature pre {
|
|
1123
|
+
margin: 0;
|
|
1124
|
+
padding: 1.2rem;
|
|
1125
|
+
overflow-x: auto;
|
|
1126
|
+
font-size: 0.85rem;
|
|
1127
|
+
line-height: 1.65;
|
|
1128
|
+
}
|
|
1129
|
+
.np-docs-api-section { padding-top: 2.5rem; }
|
|
1130
|
+
.np-docs-api-section h2 {
|
|
1131
|
+
margin: 0 0 1rem;
|
|
1132
|
+
font-size: 1.35rem;
|
|
1133
|
+
}
|
|
1134
|
+
.np-docs-api-table {
|
|
1135
|
+
border: 1px solid var(--np-color-border);
|
|
1136
|
+
border-radius: 14px;
|
|
1137
|
+
overflow: hidden;
|
|
1138
|
+
background: var(--np-color-card);
|
|
1139
|
+
}
|
|
1140
|
+
.np-docs-api-row {
|
|
1141
|
+
display: grid;
|
|
1142
|
+
grid-template-columns: 10rem 7rem minmax(0, 1fr);
|
|
1143
|
+
gap: 1rem;
|
|
1144
|
+
padding: 1rem;
|
|
1145
|
+
border-bottom: 1px solid var(--np-color-border);
|
|
1146
|
+
}
|
|
1147
|
+
.np-docs-api-row:last-child { border-bottom: 0; }
|
|
1148
|
+
.np-docs-api-row span {
|
|
1149
|
+
color: var(--np-color-primary);
|
|
1150
|
+
font-family: var(--np-font-mono);
|
|
1151
|
+
font-size: 0.76rem;
|
|
1152
|
+
}
|
|
1153
|
+
.np-docs-api-row p { margin: 0; color: var(--np-color-muted-foreground); }
|
|
1154
|
+
.np-docs-changelog-timeline {
|
|
1155
|
+
list-style: none;
|
|
1156
|
+
margin: 2rem 0 0;
|
|
1157
|
+
padding: 0;
|
|
1158
|
+
border-top: 1px solid var(--np-color-border);
|
|
1159
|
+
}
|
|
1160
|
+
.np-docs-changelog-release {
|
|
1161
|
+
display: grid;
|
|
1162
|
+
grid-template-columns: 13rem minmax(0, 1fr);
|
|
1163
|
+
gap: 2rem;
|
|
1164
|
+
padding: 1.6rem 0;
|
|
1165
|
+
border-bottom: 1px solid var(--np-color-border);
|
|
1166
|
+
}
|
|
1167
|
+
.np-docs-changelog-release aside {
|
|
1168
|
+
display: grid;
|
|
1169
|
+
gap: 0.3rem;
|
|
1170
|
+
align-content: start;
|
|
1171
|
+
}
|
|
1172
|
+
.np-docs-changelog-release aside strong {
|
|
1173
|
+
font-size: 1.25rem;
|
|
1174
|
+
letter-spacing: -0.02em;
|
|
1175
|
+
}
|
|
1176
|
+
.np-docs-changelog-release aside span,
|
|
1177
|
+
.np-docs-changelog-release aside i {
|
|
1178
|
+
color: var(--np-color-muted-foreground);
|
|
1179
|
+
font-style: normal;
|
|
1180
|
+
font-size: 0.82rem;
|
|
1181
|
+
}
|
|
1182
|
+
.np-docs-changelog-release p {
|
|
1183
|
+
display: grid;
|
|
1184
|
+
grid-template-columns: 6.5rem minmax(0, 1fr);
|
|
1185
|
+
gap: 1rem;
|
|
1186
|
+
margin: 0 0 0.85rem;
|
|
1187
|
+
}
|
|
1188
|
+
.np-docs-changelog-release p span {
|
|
1189
|
+
justify-self: start;
|
|
1190
|
+
padding: 0.12rem 0.45rem;
|
|
1191
|
+
border-radius: 999px;
|
|
1192
|
+
border: 1px solid var(--np-color-border);
|
|
1193
|
+
font-family: var(--np-font-mono);
|
|
1194
|
+
font-size: 0.7rem;
|
|
1195
|
+
color: var(--np-color-primary);
|
|
1196
|
+
}
|
|
1197
|
+
@media (max-width: 760px) {
|
|
1198
|
+
.np-docs-api-row,
|
|
1199
|
+
.np-docs-changelog-release,
|
|
1200
|
+
.np-docs-changelog-release p {
|
|
1201
|
+
grid-template-columns: 1fr;
|
|
1202
|
+
}
|
|
1203
|
+
}
|
|
1204
|
+
|
|
1073
1205
|
/* ============================================================
|
|
1074
1206
|
* Header \u2014 sticky bar with brand + version pill, \u2318K search in
|
|
1075
1207
|
* the center, primary nav + GitHub link on the right. Grid
|
|
@@ -2177,9 +2309,121 @@ var docsCss = `
|
|
|
2177
2309
|
}
|
|
2178
2310
|
`;
|
|
2179
2311
|
|
|
2312
|
+
// src/templates/page-api-reference.tsx
|
|
2313
|
+
import { jsx as jsx11, jsxs as jsxs10 } from "react/jsx-runtime";
|
|
2314
|
+
function PageApiReferenceTemplate(_props) {
|
|
2315
|
+
const params = [
|
|
2316
|
+
["manifest", "required", "Plugin metadata: id, name, version, and supported NexPress range."],
|
|
2317
|
+
["hooks", "optional", "Lifecycle hooks such as content:beforeSave and content:afterSave."],
|
|
2318
|
+
["actions", "optional", "Custom action handlers mounted under the plugin action endpoint."],
|
|
2319
|
+
["routes", "optional", "API-style route handlers registered by the plugin host."],
|
|
2320
|
+
["pageRoutes", "optional", "Public-site React routes rendered through the site shell."],
|
|
2321
|
+
["scheduled", "optional", "pg-boss scheduled tasks reconciled at boot."],
|
|
2322
|
+
["blocks", "optional", "Page-builder block definitions registered into the shared registry."]
|
|
2323
|
+
];
|
|
2324
|
+
return /* @__PURE__ */ jsxs10("article", { className: "np-docs-api", children: [
|
|
2325
|
+
/* @__PURE__ */ jsxs10("header", { className: "np-docs-api-hero", children: [
|
|
2326
|
+
/* @__PURE__ */ jsx11("p", { className: "np-docs-api-eyebrow", children: "API reference" }),
|
|
2327
|
+
/* @__PURE__ */ jsx11("h1", { children: /* @__PURE__ */ jsx11("code", { children: "definePlugin" }) }),
|
|
2328
|
+
/* @__PURE__ */ jsx11("p", { children: "Declares a NexPress plugin. v1 plugins are npm package + rebuild: they run in-process, can register hooks, actions, API routes, public page routes, scheduled tasks, and page-builder blocks." })
|
|
2329
|
+
] }),
|
|
2330
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-signature", "aria-label": "Signature", children: [
|
|
2331
|
+
/* @__PURE__ */ jsxs10("div", { className: "np-docs-api-signature-head", children: [
|
|
2332
|
+
/* @__PURE__ */ jsx11("span", { children: "Signature" }),
|
|
2333
|
+
/* @__PURE__ */ jsx11("code", { children: "@nexpress/plugin-sdk" })
|
|
2334
|
+
] }),
|
|
2335
|
+
/* @__PURE__ */ jsx11("pre", { children: `import { definePlugin } from "@nexpress/plugin-sdk";
|
|
2336
|
+
|
|
2337
|
+
export default definePlugin({
|
|
2338
|
+
manifest: {
|
|
2339
|
+
id: "reading-time",
|
|
2340
|
+
name: "Reading time",
|
|
2341
|
+
version: "0.1.0",
|
|
2342
|
+
nexpress: { minVersion: "0.1.0" },
|
|
2343
|
+
},
|
|
2344
|
+
hooks: {
|
|
2345
|
+
"content:beforeSave": async (ctx) => ctx.data,
|
|
2346
|
+
},
|
|
2347
|
+
pageRoutes: [],
|
|
2348
|
+
blocks: [],
|
|
2349
|
+
});` })
|
|
2350
|
+
] }),
|
|
2351
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-section", children: [
|
|
2352
|
+
/* @__PURE__ */ jsx11("h2", { children: "Parameters" }),
|
|
2353
|
+
/* @__PURE__ */ jsx11("div", { className: "np-docs-api-table", children: params.map(([name, state, desc]) => /* @__PURE__ */ jsxs10("div", { className: "np-docs-api-row", children: [
|
|
2354
|
+
/* @__PURE__ */ jsx11("code", { children: name }),
|
|
2355
|
+
/* @__PURE__ */ jsx11("span", { children: state }),
|
|
2356
|
+
/* @__PURE__ */ jsx11("p", { children: desc })
|
|
2357
|
+
] }, name)) })
|
|
2358
|
+
] }),
|
|
2359
|
+
/* @__PURE__ */ jsxs10("section", { className: "np-docs-api-section", children: [
|
|
2360
|
+
/* @__PURE__ */ jsx11("h2", { children: "Returns" }),
|
|
2361
|
+
/* @__PURE__ */ jsx11("p", { children: "A plugin definition object consumed by the NexPress bootstrap. The host validates the manifest and registers every declared surface in a predictable order. Capability and route checks happen at the framework boundary." })
|
|
2362
|
+
] })
|
|
2363
|
+
] });
|
|
2364
|
+
}
|
|
2365
|
+
|
|
2366
|
+
// src/templates/page-changelog.tsx
|
|
2367
|
+
import { jsx as jsx12, jsxs as jsxs11 } from "react/jsx-runtime";
|
|
2368
|
+
var RELEASES = [
|
|
2369
|
+
{
|
|
2370
|
+
version: "0.3.6",
|
|
2371
|
+
date: "May 2026",
|
|
2372
|
+
tag: "latest",
|
|
2373
|
+
changes: [
|
|
2374
|
+
["Improved", "Theme seed content now owns first-boot pages and posts per active theme."],
|
|
2375
|
+
["Added", "Built-in theme docs, magazine, and portfolio front-page render coverage."],
|
|
2376
|
+
["Fixed", "Theme-contributed fields are gated by active theme in the admin editor."]
|
|
2377
|
+
]
|
|
2378
|
+
},
|
|
2379
|
+
{
|
|
2380
|
+
version: "0.3.0",
|
|
2381
|
+
date: "May 2026",
|
|
2382
|
+
tag: "theme v0.2",
|
|
2383
|
+
changes: [
|
|
2384
|
+
["Added", "Theme routes, archives, nav locations, settings schema, and patterns."],
|
|
2385
|
+
["Added", "Docs and portfolio kinds on the universal posts collection."],
|
|
2386
|
+
["Breaking", "Legacy nx prefix moved to np across framework-owned identifiers."]
|
|
2387
|
+
]
|
|
2388
|
+
},
|
|
2389
|
+
{
|
|
2390
|
+
version: "0.2.0",
|
|
2391
|
+
date: "April 2026",
|
|
2392
|
+
tag: "pre-1.0",
|
|
2393
|
+
changes: [
|
|
2394
|
+
["Added", "Plugin page routes and page-builder block contributions."],
|
|
2395
|
+
["Improved", "pg-boss worker lifecycle and admin jobs surface."],
|
|
2396
|
+
["Fixed", "CSRF and rate limiting now live in the app proxy boundary."]
|
|
2397
|
+
]
|
|
2398
|
+
}
|
|
2399
|
+
];
|
|
2400
|
+
function PageChangelogTemplate(_props) {
|
|
2401
|
+
return /* @__PURE__ */ jsxs11("article", { className: "np-docs-changelog-page", children: [
|
|
2402
|
+
/* @__PURE__ */ jsxs11("header", { className: "np-docs-changelog-hero", children: [
|
|
2403
|
+
/* @__PURE__ */ jsx12("p", { children: "Changelog" }),
|
|
2404
|
+
/* @__PURE__ */ jsx12("h1", { children: "Every shipped change, in reverse." }),
|
|
2405
|
+
/* @__PURE__ */ jsx12("span", { children: "Pre-1.0 packages use minor releases for breaking changes." })
|
|
2406
|
+
] }),
|
|
2407
|
+
/* @__PURE__ */ jsx12("ol", { className: "np-docs-changelog-timeline", children: RELEASES.map((release) => /* @__PURE__ */ jsxs11("li", { className: "np-docs-changelog-release", children: [
|
|
2408
|
+
/* @__PURE__ */ jsxs11("aside", { children: [
|
|
2409
|
+
/* @__PURE__ */ jsxs11("strong", { children: [
|
|
2410
|
+
"v",
|
|
2411
|
+
release.version
|
|
2412
|
+
] }),
|
|
2413
|
+
/* @__PURE__ */ jsx12("span", { children: release.date }),
|
|
2414
|
+
/* @__PURE__ */ jsx12("i", { children: release.tag })
|
|
2415
|
+
] }),
|
|
2416
|
+
/* @__PURE__ */ jsx12("div", { children: release.changes.map(([kind, text]) => /* @__PURE__ */ jsxs11("p", { children: [
|
|
2417
|
+
/* @__PURE__ */ jsx12("span", { "data-kind": kind.toLowerCase(), children: kind }),
|
|
2418
|
+
text
|
|
2419
|
+
] }, `${release.version}-${text}`)) })
|
|
2420
|
+
] }, release.version)) })
|
|
2421
|
+
] });
|
|
2422
|
+
}
|
|
2423
|
+
|
|
2180
2424
|
// src/templates/page-front.tsx
|
|
2181
2425
|
import { findDocuments as findDocuments4 } from "@nexpress/core";
|
|
2182
|
-
import { jsx as
|
|
2426
|
+
import { jsx as jsx13, jsxs as jsxs12 } from "react/jsx-runtime";
|
|
2183
2427
|
async function PageFrontTemplate(_props) {
|
|
2184
2428
|
const settings = await resolveDocsSettings();
|
|
2185
2429
|
const result = await findDocuments4("posts", {
|
|
@@ -2194,22 +2438,22 @@ async function PageFrontTemplate(_props) {
|
|
|
2194
2438
|
(c) => c.slug === "author-quickstart"
|
|
2195
2439
|
);
|
|
2196
2440
|
const quickstartTarget = quickstartChild ?? tree[0]?.children[0] ?? tree[0] ?? null;
|
|
2197
|
-
return /* @__PURE__ */
|
|
2198
|
-
/* @__PURE__ */
|
|
2199
|
-
/* @__PURE__ */
|
|
2200
|
-
/* @__PURE__ */
|
|
2441
|
+
return /* @__PURE__ */ jsxs12("article", { className: "np-docs-front", children: [
|
|
2442
|
+
/* @__PURE__ */ jsxs12("header", { className: "np-docs-front-hero", children: [
|
|
2443
|
+
/* @__PURE__ */ jsxs12("span", { className: "np-docs-front-eyebrow", children: [
|
|
2444
|
+
/* @__PURE__ */ jsx13("span", { className: "np-docs-front-eyebrow-dot", "aria-hidden": "true" }),
|
|
2201
2445
|
settings.version,
|
|
2202
|
-
/* @__PURE__ */
|
|
2446
|
+
/* @__PURE__ */ jsx13("span", { "aria-hidden": "true", children: " \xB7 Stable" })
|
|
2203
2447
|
] }),
|
|
2204
|
-
/* @__PURE__ */
|
|
2205
|
-
/* @__PURE__ */
|
|
2206
|
-
quickstartTarget ? /* @__PURE__ */
|
|
2207
|
-
/* @__PURE__ */
|
|
2448
|
+
/* @__PURE__ */ jsx13("h1", { children: "Documentation" }),
|
|
2449
|
+
/* @__PURE__ */ jsx13("p", { className: "np-docs-front-lede", children: "Everything you need to install, configure, extend, and ship a NexPress site \u2014 from a first install to the API reference. Browse by section, or jump straight into the plugin author quickstart." }),
|
|
2450
|
+
quickstartTarget ? /* @__PURE__ */ jsxs12("div", { className: "np-docs-front-cta", children: [
|
|
2451
|
+
/* @__PURE__ */ jsxs12("a", { className: "np-docs-front-cta-primary", href: `/docs/${quickstartTarget.slug}`, children: [
|
|
2208
2452
|
"Open ",
|
|
2209
2453
|
quickstartTarget.title,
|
|
2210
2454
|
" \u2192"
|
|
2211
2455
|
] }),
|
|
2212
|
-
settings.githubRepo ? /* @__PURE__ */
|
|
2456
|
+
settings.githubRepo ? /* @__PURE__ */ jsx13(
|
|
2213
2457
|
"a",
|
|
2214
2458
|
{
|
|
2215
2459
|
className: "np-docs-front-cta-secondary",
|
|
@@ -2221,24 +2465,24 @@ async function PageFrontTemplate(_props) {
|
|
|
2221
2465
|
) : null
|
|
2222
2466
|
] }) : null
|
|
2223
2467
|
] }),
|
|
2224
|
-
tree.length > 0 ? /* @__PURE__ */
|
|
2468
|
+
tree.length > 0 ? /* @__PURE__ */ jsx13("section", { className: "np-docs-front-groups", "aria-label": "Documentation sections", children: tree.map((group) => /* @__PURE__ */ jsxs12(
|
|
2225
2469
|
"a",
|
|
2226
2470
|
{
|
|
2227
2471
|
className: "np-docs-front-group",
|
|
2228
2472
|
href: `/docs/${group.slug}`,
|
|
2229
2473
|
children: [
|
|
2230
|
-
/* @__PURE__ */
|
|
2474
|
+
/* @__PURE__ */ jsxs12("h2", { className: "np-docs-front-group-title", children: [
|
|
2231
2475
|
group.title,
|
|
2232
|
-
/* @__PURE__ */
|
|
2476
|
+
/* @__PURE__ */ jsxs12("span", { className: "np-docs-front-group-count", children: [
|
|
2233
2477
|
group.children.length.toString(),
|
|
2234
2478
|
" page",
|
|
2235
2479
|
group.children.length === 1 ? "" : "s"
|
|
2236
2480
|
] })
|
|
2237
2481
|
] }),
|
|
2238
|
-
group.lede ? /* @__PURE__ */
|
|
2239
|
-
group.children.length > 0 ? /* @__PURE__ */
|
|
2482
|
+
group.lede ? /* @__PURE__ */ jsx13("p", { className: "np-docs-front-group-lede", children: group.lede }) : null,
|
|
2483
|
+
group.children.length > 0 ? /* @__PURE__ */ jsx13("ul", { className: "np-docs-front-group-children", children: group.children.slice(0, 4).map((child) => /* @__PURE__ */ jsxs12("li", { children: [
|
|
2240
2484
|
child.title,
|
|
2241
|
-
child.badge ? /* @__PURE__ */
|
|
2485
|
+
child.badge ? /* @__PURE__ */ jsx13(
|
|
2242
2486
|
"span",
|
|
2243
2487
|
{
|
|
2244
2488
|
className: `np-docs-sidebar-badge ${child.badge.toLowerCase()}`,
|
|
@@ -2250,16 +2494,16 @@ async function PageFrontTemplate(_props) {
|
|
|
2250
2494
|
},
|
|
2251
2495
|
group.id
|
|
2252
2496
|
)) }) : null,
|
|
2253
|
-
recent.length > 0 ? /* @__PURE__ */
|
|
2497
|
+
recent.length > 0 ? /* @__PURE__ */ jsxs12(
|
|
2254
2498
|
"section",
|
|
2255
2499
|
{
|
|
2256
2500
|
className: "np-docs-front-recent",
|
|
2257
2501
|
"aria-label": "Recently updated docs",
|
|
2258
2502
|
children: [
|
|
2259
|
-
/* @__PURE__ */
|
|
2260
|
-
/* @__PURE__ */
|
|
2261
|
-
/* @__PURE__ */
|
|
2262
|
-
node.updatedAt ? /* @__PURE__ */
|
|
2503
|
+
/* @__PURE__ */ jsx13("h2", { className: "np-docs-front-recent-eyebrow", children: "Recently updated" }),
|
|
2504
|
+
/* @__PURE__ */ jsx13("ul", { className: "np-docs-front-recent-list", children: recent.map((node) => /* @__PURE__ */ jsx13("li", { children: /* @__PURE__ */ jsxs12("a", { href: `/docs/${node.slug}`, children: [
|
|
2505
|
+
/* @__PURE__ */ jsx13("span", { className: "np-docs-front-recent-title", children: node.title }),
|
|
2506
|
+
node.updatedAt ? /* @__PURE__ */ jsx13(
|
|
2263
2507
|
"time",
|
|
2264
2508
|
{
|
|
2265
2509
|
className: "np-docs-front-recent-time",
|
|
@@ -2339,15 +2583,30 @@ function formatRelative(iso) {
|
|
|
2339
2583
|
// src/index.ts
|
|
2340
2584
|
var SEED_NAV = {
|
|
2341
2585
|
header: [
|
|
2342
|
-
{ id: "nav-docs-docs", label: "Docs", type: "link", url: "/
|
|
2586
|
+
{ id: "nav-docs-docs", label: "Docs", type: "link", url: "/" },
|
|
2343
2587
|
{ id: "nav-docs-reference", label: "Reference", type: "link", url: "/docs/reference" },
|
|
2344
2588
|
{ id: "nav-docs-blog", label: "Blog", type: "link", url: "/blog" }
|
|
2345
2589
|
],
|
|
2346
2590
|
footer: [
|
|
2347
|
-
{ id: "nav-docs-footer-docs", label: "Documentation", type: "link", url: "/
|
|
2348
|
-
{
|
|
2349
|
-
|
|
2350
|
-
|
|
2591
|
+
{ id: "nav-docs-footer-docs", label: "Documentation", type: "link", url: "/" },
|
|
2592
|
+
{
|
|
2593
|
+
id: "nav-docs-footer-reference",
|
|
2594
|
+
label: "Reference",
|
|
2595
|
+
type: "link",
|
|
2596
|
+
url: "/docs/reference"
|
|
2597
|
+
},
|
|
2598
|
+
{
|
|
2599
|
+
id: "nav-docs-footer-changelog",
|
|
2600
|
+
label: "Changelog",
|
|
2601
|
+
type: "link",
|
|
2602
|
+
url: "/changelog"
|
|
2603
|
+
},
|
|
2604
|
+
{
|
|
2605
|
+
id: "nav-docs-footer-github",
|
|
2606
|
+
label: "GitHub",
|
|
2607
|
+
type: "link",
|
|
2608
|
+
url: "https://github.com"
|
|
2609
|
+
}
|
|
2351
2610
|
]
|
|
2352
2611
|
};
|
|
2353
2612
|
function paragraph(text) {
|
|
@@ -2357,15 +2616,17 @@ function paragraph(text) {
|
|
|
2357
2616
|
direction: null,
|
|
2358
2617
|
format: "",
|
|
2359
2618
|
indent: 0,
|
|
2360
|
-
children: [
|
|
2361
|
-
|
|
2362
|
-
|
|
2363
|
-
|
|
2364
|
-
|
|
2365
|
-
|
|
2366
|
-
|
|
2367
|
-
|
|
2368
|
-
|
|
2619
|
+
children: [
|
|
2620
|
+
{
|
|
2621
|
+
type: "text",
|
|
2622
|
+
version: 1,
|
|
2623
|
+
detail: 0,
|
|
2624
|
+
format: 0,
|
|
2625
|
+
mode: "normal",
|
|
2626
|
+
style: "",
|
|
2627
|
+
text
|
|
2628
|
+
}
|
|
2629
|
+
]
|
|
2369
2630
|
};
|
|
2370
2631
|
}
|
|
2371
2632
|
function heading(tag, text) {
|
|
@@ -2376,15 +2637,17 @@ function heading(tag, text) {
|
|
|
2376
2637
|
direction: null,
|
|
2377
2638
|
format: "",
|
|
2378
2639
|
indent: 0,
|
|
2379
|
-
children: [
|
|
2380
|
-
|
|
2381
|
-
|
|
2382
|
-
|
|
2383
|
-
|
|
2384
|
-
|
|
2385
|
-
|
|
2386
|
-
|
|
2387
|
-
|
|
2640
|
+
children: [
|
|
2641
|
+
{
|
|
2642
|
+
type: "text",
|
|
2643
|
+
version: 1,
|
|
2644
|
+
detail: 0,
|
|
2645
|
+
format: 0,
|
|
2646
|
+
mode: "normal",
|
|
2647
|
+
style: "",
|
|
2648
|
+
text
|
|
2649
|
+
}
|
|
2650
|
+
]
|
|
2388
2651
|
};
|
|
2389
2652
|
}
|
|
2390
2653
|
function codeBlock(text, language) {
|
|
@@ -2395,15 +2658,17 @@ function codeBlock(text, language) {
|
|
|
2395
2658
|
direction: null,
|
|
2396
2659
|
format: "",
|
|
2397
2660
|
indent: 0,
|
|
2398
|
-
children: [
|
|
2399
|
-
|
|
2400
|
-
|
|
2401
|
-
|
|
2402
|
-
|
|
2403
|
-
|
|
2404
|
-
|
|
2405
|
-
|
|
2406
|
-
|
|
2661
|
+
children: [
|
|
2662
|
+
{
|
|
2663
|
+
type: "text",
|
|
2664
|
+
version: 1,
|
|
2665
|
+
detail: 0,
|
|
2666
|
+
format: 0,
|
|
2667
|
+
mode: "normal",
|
|
2668
|
+
style: "",
|
|
2669
|
+
text
|
|
2670
|
+
}
|
|
2671
|
+
]
|
|
2407
2672
|
};
|
|
2408
2673
|
}
|
|
2409
2674
|
function listItem(text) {
|
|
@@ -2414,15 +2679,17 @@ function listItem(text) {
|
|
|
2414
2679
|
direction: null,
|
|
2415
2680
|
format: "",
|
|
2416
2681
|
indent: 0,
|
|
2417
|
-
children: [
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2682
|
+
children: [
|
|
2683
|
+
{
|
|
2684
|
+
type: "text",
|
|
2685
|
+
version: 1,
|
|
2686
|
+
detail: 0,
|
|
2687
|
+
format: 0,
|
|
2688
|
+
mode: "normal",
|
|
2689
|
+
style: "",
|
|
2690
|
+
text
|
|
2691
|
+
}
|
|
2692
|
+
]
|
|
2426
2693
|
};
|
|
2427
2694
|
}
|
|
2428
2695
|
function bulletList(items) {
|
|
@@ -2456,7 +2723,9 @@ function stubDoc(opts) {
|
|
|
2456
2723
|
title: opts.title,
|
|
2457
2724
|
excerpt: opts.lede ?? `${opts.title} reference page.`,
|
|
2458
2725
|
content: lexicalDoc([
|
|
2459
|
-
paragraph(
|
|
2726
|
+
paragraph(
|
|
2727
|
+
`Placeholder body for ${opts.title}. Operators replace this once they're set up \u2014 every doc-kind post renders through the three-column docs template.`
|
|
2728
|
+
)
|
|
2460
2729
|
]),
|
|
2461
2730
|
publishedAt: DOCS_NOW,
|
|
2462
2731
|
kind: "doc",
|
|
@@ -2547,9 +2816,7 @@ var QUICKSTART_BODY = lexicalDoc([
|
|
|
2547
2816
|
"Hooks block the response: onDocumentPublished runs inside the publish request. Long-running work \u2014 sending emails, regenerating sitemaps \u2014 belongs in onSchedule or a queued job. Otherwise the editor will wait on it."
|
|
2548
2817
|
),
|
|
2549
2818
|
heading("h2", "Next steps"),
|
|
2550
|
-
paragraph(
|
|
2551
|
-
"You have a plugin that runs. Two natural directions from here:"
|
|
2552
|
-
),
|
|
2819
|
+
paragraph("You have a plugin that runs. Two natural directions from here:"),
|
|
2553
2820
|
bulletList([
|
|
2554
2821
|
"Add a route. Declare a routes entry in the manifest to expose a public URL \u2014 for webhooks, OAuth callbacks, or a custom admin screen.",
|
|
2555
2822
|
"Add collections. Plugins can declare their own collections, which the admin surfaces alongside the operator's. See the Plugin manifest reference."
|
|
@@ -2562,6 +2829,20 @@ var SEED_PAGES = [
|
|
|
2562
2829
|
seoDescription: "Install NexPress, learn the core concepts, write plugins, and look up the API.",
|
|
2563
2830
|
blocks: [],
|
|
2564
2831
|
template: "front"
|
|
2832
|
+
},
|
|
2833
|
+
{
|
|
2834
|
+
title: "definePlugin",
|
|
2835
|
+
slug: "docs/reference/define-plugin",
|
|
2836
|
+
seoDescription: "API reference for definePlugin from @nexpress/plugin-sdk.",
|
|
2837
|
+
blocks: [],
|
|
2838
|
+
template: "apiReference"
|
|
2839
|
+
},
|
|
2840
|
+
{
|
|
2841
|
+
title: "Changelog",
|
|
2842
|
+
slug: "changelog",
|
|
2843
|
+
seoDescription: "Reverse-chronological changelog for NexPress pre-1.0 releases.",
|
|
2844
|
+
blocks: [],
|
|
2845
|
+
template: "changelog"
|
|
2565
2846
|
}
|
|
2566
2847
|
];
|
|
2567
2848
|
var SEED_DOCS = [
|
|
@@ -2577,7 +2858,12 @@ var SEED_DOCS = [
|
|
|
2577
2858
|
lede: "What NexPress is, what it isn't, and who it's for.",
|
|
2578
2859
|
stableSince: "Stable since 0.1"
|
|
2579
2860
|
}),
|
|
2580
|
-
stubDoc({
|
|
2861
|
+
stubDoc({
|
|
2862
|
+
title: "Install & bootstrap",
|
|
2863
|
+
parentSlug: "get-started",
|
|
2864
|
+
order: 1,
|
|
2865
|
+
stableSince: "Stable since 0.1"
|
|
2866
|
+
}),
|
|
2581
2867
|
stubDoc({ title: "Project structure", parentSlug: "get-started", order: 2 }),
|
|
2582
2868
|
stubDoc({ title: "Configuration", parentSlug: "get-started", order: 3 }),
|
|
2583
2869
|
stubDoc({ title: "Deployment", parentSlug: "get-started", order: 4 }),
|
|
@@ -2586,7 +2872,12 @@ var SEED_DOCS = [
|
|
|
2586
2872
|
order: 1,
|
|
2587
2873
|
lede: "The model behind collections, themes, plugins, and blocks."
|
|
2588
2874
|
}),
|
|
2589
|
-
stubDoc({
|
|
2875
|
+
stubDoc({
|
|
2876
|
+
title: "Collections",
|
|
2877
|
+
parentSlug: "core-concepts",
|
|
2878
|
+
order: 0,
|
|
2879
|
+
stableSince: "Stable since 0.1"
|
|
2880
|
+
}),
|
|
2590
2881
|
stubDoc({ title: "Pages & routing", parentSlug: "core-concepts", order: 1 }),
|
|
2591
2882
|
stubDoc({ title: "Themes", parentSlug: "core-concepts", order: 2 }),
|
|
2592
2883
|
stubDoc({ title: "Blocks", parentSlug: "core-concepts", order: 3 }),
|
|
@@ -2748,6 +3039,16 @@ var docsTheme = defineTheme({
|
|
|
2748
3039
|
label: "Front page",
|
|
2749
3040
|
description: 'Docs landing \u2014 hero + 2x2 group cards walking the kind="doc" tree + recently-updated row. The seeded home page (slug "/") ships with this template.',
|
|
2750
3041
|
component: PageFrontTemplate
|
|
3042
|
+
},
|
|
3043
|
+
apiReference: {
|
|
3044
|
+
label: "API reference",
|
|
3045
|
+
description: "Docs reference page with signature, parameter table, and return contract.",
|
|
3046
|
+
component: PageApiReferenceTemplate
|
|
3047
|
+
},
|
|
3048
|
+
changelog: {
|
|
3049
|
+
label: "Changelog",
|
|
3050
|
+
description: "Reverse-chronological release timeline with typed change labels.",
|
|
3051
|
+
component: PageChangelogTemplate
|
|
2751
3052
|
}
|
|
2752
3053
|
},
|
|
2753
3054
|
// Universal-content-model #748 — docs are posts with
|
|
@@ -2829,6 +3130,8 @@ export {
|
|
|
2829
3130
|
DocsSearch,
|
|
2830
3131
|
DocsShell,
|
|
2831
3132
|
DocsSidebar,
|
|
3133
|
+
PageApiReferenceTemplate,
|
|
3134
|
+
PageChangelogTemplate,
|
|
2832
3135
|
docsBlocks,
|
|
2833
3136
|
docsCss,
|
|
2834
3137
|
docsSettingsSchema,
|