@publish.os/nextjs 0.0.1-alpha.6 → 0.0.1-alpha.7
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/README.md +3 -5
- package/compiler-assets/nextjs/defaults/app/globals.css +6 -0
- package/compiler-assets/nextjs/defaults/group/layout.tsx +23 -0
- package/compiler-assets/nextjs/defaults/group/leaf.tsx +48 -0
- package/compiler-assets/nextjs/defaults/group/page.tsx +50 -0
- package/compiler-assets/nextjs/defaults/project/next.config.mjs +45 -0
- package/compiler-assets/nextjs/defaults/project/postcss.config.mjs +5 -0
- package/compiler-assets/nextjs/defaults/project/tsconfig.json.template +41 -0
- package/compiler-assets/nextjs/defaults/root/css/animation.css +90 -0
- package/compiler-assets/nextjs/defaults/root/css/components/dialog.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/drawer.css +21 -0
- package/compiler-assets/nextjs/defaults/root/css/components/menu.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/navigation-menu.css +25 -0
- package/compiler-assets/nextjs/defaults/root/css/components/popover.css +17 -0
- package/compiler-assets/nextjs/defaults/root/css/components/select.css +23 -0
- package/compiler-assets/nextjs/defaults/root/css/components/toast.css +19 -0
- package/compiler-assets/nextjs/defaults/root/css/components/tooltip.css +15 -0
- package/compiler-assets/nextjs/defaults/root/css/layout.css +22 -0
- package/compiler-assets/nextjs/defaults/root/css/media.css +81 -0
- package/compiler-assets/nextjs/defaults/root/css/radius.css +49 -0
- package/compiler-assets/nextjs/defaults/root/css/scrollbar.css +43 -0
- package/compiler-assets/nextjs/defaults/root/css/shadow.css +145 -0
- package/compiler-assets/nextjs/defaults/root/css/typography.css +607 -0
- package/compiler-assets/nextjs/defaults/root/css/zindex.css +39 -0
- package/compiler-assets/nextjs/defaults/root/globals.css +191 -0
- package/compiler-assets/nextjs/defaults/root/layout.tsx +19 -0
- package/compiler-assets/nextjs/defaults/root/page.tsx +61 -0
- package/compiler-assets/nextjs/defaults/root/theme.css +50 -0
- package/compiler-assets/nextjs/defaults/source/_internal/logger.ts +21 -0
- package/compiler-assets/nextjs/shims/generated-group-layout.tsx +19 -0
- package/compiler-assets/nextjs/shims/generated-group-page.tsx +18 -0
- package/compiler-assets/nextjs/shims/generated-leaf-page.tsx +21 -0
- package/compiler-assets/nextjs/shims/global-layout.tsx +134 -0
- package/compiler-assets/nextjs/shims/markdown-route.ts +29 -0
- package/compiler-assets/nextjs/shims/og-image-route.ts +18 -0
- package/compiler-assets/nextjs/shims/powered-by-footer.tsx +40 -0
- package/compiler-assets/nextjs/shims/providers.tsx +13 -0
- package/compiler-assets/nextjs/shims/proxy.ts +317 -0
- package/compiler-assets/nextjs/shims/publish-os-theme-provider.tsx +77 -0
- package/compiler-assets/nextjs/shims/root-page.tsx +13 -0
- package/compiler-assets/nextjs/shims/theme-defaults.css +177 -0
- package/dist/button-CFdx-ohV.d.ts +20 -0
- package/dist/cache/tags.js +6 -14
- package/dist/compiler.d.ts +100 -0
- package/dist/compiler.js +13379 -0
- package/dist/config/createNextConfig.d.ts +2 -1
- package/dist/config/createNextConfig.js +16 -12
- package/dist/icons.d.ts +1 -0
- package/dist/icons.js +2 -0
- package/dist/index.d.ts +303 -15
- package/dist/index.js +30 -1198
- package/dist/kernel/components/blocks/AgentActions.d.ts +9 -3
- package/dist/kernel/components/blocks/AgentActions.js +114 -200
- package/dist/kernel/components/blocks/animated-icon-swap.js +4 -25
- package/dist/kernel/components/blocks/color-palette.js +88 -169
- package/dist/kernel/components/blocks/design-system-preview.d.ts +38 -6
- package/dist/kernel/components/blocks/design-system-preview.js +44 -52
- package/dist/kernel/components/blocks/link-playground.js +23 -71
- package/dist/kernel/components/blocks/logo-block.js +18 -47
- package/dist/kernel/components/blocks/nav-breadcrumb.d.ts +1 -1
- package/dist/kernel/components/blocks/nav-breadcrumb.js +28 -42
- package/dist/kernel/components/blocks/navbar.d.ts +1 -1
- package/dist/kernel/components/blocks/navbar.js +14 -41
- package/dist/kernel/components/blocks/navigation-progress-playground.js +56 -149
- package/dist/kernel/components/blocks/navigation-progress.js +53 -157
- package/dist/kernel/components/blocks/next-prev.d.ts +1 -1
- package/dist/kernel/components/blocks/next-prev.js +16 -42
- package/dist/kernel/components/blocks/page-list.d.ts +1 -1
- package/dist/kernel/components/blocks/page-list.js +11 -16
- package/dist/kernel/components/blocks/search.d.ts +13 -2
- package/dist/kernel/components/blocks/search.js +116 -247
- package/dist/kernel/components/blocks/sidebar-node.d.ts +2 -2
- package/dist/kernel/components/blocks/sidebar-node.js +56 -95
- package/dist/kernel/components/blocks/sidebar.d.ts +5 -23
- package/dist/kernel/components/blocks/sidebar.js +35 -103
- package/dist/kernel/components/blocks/theme-toggle.d.ts +7 -3
- package/dist/kernel/components/blocks/theme-toggle.js +2 -2
- package/dist/kernel/components/blocks/toc.js +42 -178
- package/dist/kernel/components/mdx/components/blockquote.js +3 -24
- package/dist/kernel/components/mdx/components/callout.d.ts +1 -1
- package/dist/kernel/components/mdx/components/callout.js +15 -47
- package/dist/kernel/components/mdx/components/code-block.js +2 -2
- package/dist/kernel/components/mdx/components/figure-caption.js +6 -24
- package/dist/kernel/components/mdx/components/figure.js +9 -36
- package/dist/kernel/components/mdx/components/footnotes.js +3 -24
- package/dist/kernel/components/mdx/components/heading-copy-link.js +13 -37
- package/dist/kernel/components/mdx/components/heading.d.ts +8 -3
- package/dist/kernel/components/mdx/components/heading.js +32 -116
- package/dist/kernel/components/mdx/components/hr.d.ts +5 -3
- package/dist/kernel/components/mdx/components/hr.js +2 -2
- package/dist/kernel/components/mdx/components/image-zoom.js +2 -3
- package/dist/kernel/components/mdx/components/image.js +22 -62
- package/dist/kernel/components/mdx/components/inline-code.js +3 -24
- package/dist/kernel/components/mdx/components/kbd.d.ts +9 -4
- package/dist/kernel/components/mdx/components/kbd.js +2 -2
- package/dist/kernel/components/mdx/components/link.d.ts +1 -2
- package/dist/kernel/components/mdx/components/link.js +2 -2
- package/dist/kernel/components/mdx/components/paragraph.js +13 -41
- package/dist/kernel/components/mdx/components/pre.js +3 -24
- package/dist/kernel/components/mdx/components/strikethrough.js +6 -24
- package/dist/kernel/components/mdx/components/table.js +2 -2
- package/dist/kernel/components/mdx/components/task-list.js +6 -28
- package/dist/kernel/components/mdx/components/video-player.js +53 -88
- package/dist/kernel/components/mdx/components/video.js +27 -75
- package/dist/kernel/components/mdx/error-boundary.d.ts +1 -1
- package/dist/kernel/components/mdx/error-boundary.js +12 -15
- package/dist/kernel/components/mdx/error-fallback.js +4 -4
- package/dist/kernel/components/mdx/mdx.d.ts +68 -11
- package/dist/kernel/components/mdx/mdx.js +29 -29
- package/dist/kernel/components/mdx/rehype-heading-ids.js +11 -67
- package/dist/kernel/components/mdx/types.d.ts +1 -1
- package/dist/kernel/components/ui/accordion.js +3 -26
- package/dist/kernel/components/ui/breadcrumb-trail.d.ts +23 -7
- package/dist/kernel/components/ui/breadcrumb-trail.js +32 -80
- package/dist/kernel/components/ui/breadcrumb.d.ts +1 -1
- package/dist/kernel/components/ui/breadcrumb.js +20 -54
- package/dist/kernel/components/ui/button-group.d.ts +4 -3
- package/dist/kernel/components/ui/button-group.js +7 -30
- package/dist/kernel/components/ui/button.js +13 -36
- package/dist/kernel/components/ui/card.d.ts +2 -2
- package/dist/kernel/components/ui/card.js +2 -23
- package/dist/kernel/components/ui/dialog.d.ts +9 -9
- package/dist/kernel/components/ui/dialog.js +15 -33
- package/dist/kernel/components/ui/drawer.d.ts +10 -10
- package/dist/kernel/components/ui/drawer.js +15 -33
- package/dist/kernel/components/ui/input.js +6 -30
- package/dist/kernel/components/ui/kbd.js +10 -31
- package/dist/kernel/components/ui/link.d.ts +1 -1
- package/dist/kernel/components/ui/link.js +53 -104
- package/dist/kernel/components/ui/menu.d.ts +21 -21
- package/dist/kernel/components/ui/menu.js +10 -32
- package/dist/kernel/components/ui/meta-key.d.ts +9 -4
- package/dist/kernel/components/ui/meta-key.js +2 -2
- package/dist/kernel/components/ui/navigation-menu.d.ts +14 -14
- package/dist/kernel/components/ui/navigation-menu.js +9 -30
- package/dist/kernel/components/ui/popover.d.ts +10 -10
- package/dist/kernel/components/ui/popover.js +19 -34
- package/dist/kernel/components/ui/progress.js +2 -25
- package/dist/kernel/components/ui/scroll-area.js +39 -118
- package/dist/kernel/components/ui/select.d.ts +15 -15
- package/dist/kernel/components/ui/select.js +19 -35
- package/dist/kernel/components/ui/separator.js +2 -25
- package/dist/kernel/components/ui/table.js +2 -23
- package/dist/kernel/components/ui/tabs.js +39 -99
- package/dist/kernel/components/ui/tag.d.ts +2 -2
- package/dist/kernel/components/ui/tag.js +4 -25
- package/dist/kernel/components/ui/text.d.ts +2 -2
- package/dist/kernel/components/ui/text.js +3 -25
- package/dist/kernel/components/ui/theme-toggle.d.ts +18 -4
- package/dist/kernel/components/ui/theme-toggle.js +18 -44
- package/dist/kernel/components/ui/toast.d.ts +10 -10
- package/dist/kernel/components/ui/toast.js +13 -35
- package/dist/kernel/components/ui/tooltip.d.ts +8 -8
- package/dist/kernel/components/ui/tooltip.js +8 -29
- package/dist/kernel/defaults.registry.d.ts +1 -1
- package/dist/kernel/defaults.registry.js +2 -2
- package/dist/kernel/framework-icons.d.ts +1 -0
- package/dist/kernel/framework-icons.js +39 -0
- package/dist/kernel/routes/agent/markdown.js +36 -65
- package/dist/kernel/routes/layouts/group.d.ts +1 -1
- package/dist/kernel/routes/layouts/group.js +20 -109
- package/dist/kernel/routes/metadata/feed.d.ts +1 -2
- package/dist/kernel/routes/metadata/feed.js +46 -127
- package/dist/kernel/routes/metadata/llms.d.ts +1 -2
- package/dist/kernel/routes/metadata/llms.js +40 -120
- package/dist/kernel/routes/metadata/og-image.d.ts +10 -0
- package/dist/kernel/routes/metadata/og-image.js +264 -198
- package/dist/kernel/routes/metadata/robots.d.ts +1 -2
- package/dist/kernel/routes/metadata/robots.js +21 -90
- package/dist/kernel/routes/metadata/sitemap.d.ts +1 -2
- package/dist/kernel/routes/metadata/sitemap.js +36 -102
- package/dist/kernel/routes/pages/group.d.ts +1 -1
- package/dist/kernel/routes/pages/group.js +42 -137
- package/dist/kernel/routes/pages/leaf.d.ts +1 -1
- package/dist/kernel/routes/pages/leaf.js +74 -213
- package/dist/kernel/routes/pages/root.d.ts +1 -1
- package/dist/kernel/routes/pages/root.js +37 -108
- package/dist/keyboard-shortcuts.js +69 -141
- package/dist/link-CYaCRDb6.d.ts +35 -0
- package/dist/resolvers/manifest-resolver.d.ts +3 -3
- package/dist/resolvers/manifest-resolver.js +15 -21
- package/dist/route-metadata-og-image-BeKKFHg7.d.ts +58 -0
- package/dist/search.d.ts +81 -4
- package/dist/search.js +124 -195
- package/dist/sidebar-types-Bgchdfd6.d.ts +25 -0
- package/dist/theme-scope.d.ts +15 -0
- package/dist/theme-scope.js +23 -0
- package/dist/types-B_b3C0U6.d.ts +63 -0
- package/dist/types-CIwwieNw.d.ts +127 -0
- package/dist/types-DHBm7-j6.d.ts +57 -0
- package/dist/types-sM2g9nW0.d.ts +12 -0
- package/dist/types.d.ts +0 -1
- package/dist/types.js +1 -1
- package/dist/utils/cn.d.ts +5 -9
- package/dist/utils/cn.js +13 -7
- package/dist/utils/heading-ids.js +20 -47
- package/dist/utils/pretty-date.js +7 -13
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.dark.png +0 -0
- package/init/seed/minimal/publish.os/assets/logo/publish-dev-logo.png +0 -0
- package/init/seed/minimal/publish.os/docs/content/get-started.mdx +54 -0
- package/init/seed/minimal/publish.os/docs/content/groups.mdx +31 -0
- package/init/seed/minimal/publish.os/docs/content/theme.mdx +64 -0
- package/init/seed/minimal/publish.os/publish.os.config.json +21 -0
- package/init/seed/minimal/publish.os/theme.css +47 -0
- package/init/seed/minimal/seed.json +13 -0
- package/package.json +469 -35
- package/release/{package.json → app/lucide/package.json} +11 -5
- package/release/app/lucide/pnpm-lock.yaml.template +2905 -0
- package/release/app/lucide/pnpm-workspace.yaml +11 -0
- package/release/app/phosphor/package.json +30 -0
- package/release/app/phosphor/pnpm-lock.yaml.template +2908 -0
- package/release/app/phosphor/pnpm-workspace.yaml +11 -0
- package/release/app/tabler/package.json +30 -0
- package/release/app/tabler/pnpm-lock.yaml.template +2911 -0
- package/release/app/tabler/pnpm-workspace.yaml +11 -0
- package/release/compiler/package.json +20 -0
- package/release/compiler/pnpm-lock.yaml.template +2432 -0
- package/release/compiler/pnpm-workspace.yaml +11 -0
- package/release/release.json +29 -5
- package/release/runtime-pnpm-lock.yaml +0 -1316
|
@@ -1,117 +1,48 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/route-metadata-robots.ts
|
|
2
|
+
import { tags } from "@publish.os/nextjs/cache/tags";
|
|
2
3
|
import { cacheLife, cacheTag } from "next/cache";
|
|
3
4
|
|
|
4
|
-
// src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function safeSegment(value) {
|
|
13
|
-
const raw = value.trim().toLowerCase() || "root";
|
|
14
|
-
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
15
|
-
const segment = normalized || "root";
|
|
16
|
-
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
17
|
-
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
18
|
-
}
|
|
19
|
-
function assertTag(tag) {
|
|
20
|
-
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
21
|
-
return `tag:${sha256(tag)}`;
|
|
5
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
6
|
+
function canonicalUrl(manifest, path) {
|
|
7
|
+
let origin = manifest.site.url?.replace(/\/+$/, "");
|
|
8
|
+
if (!origin) return path;
|
|
9
|
+
try {
|
|
10
|
+
return new URL(path, `${origin}/`).toString();
|
|
11
|
+
} catch {
|
|
12
|
+
return path;
|
|
22
13
|
}
|
|
23
|
-
return tag;
|
|
24
14
|
}
|
|
25
|
-
var tags = {
|
|
26
|
-
site() {
|
|
27
|
-
return "site";
|
|
28
|
-
},
|
|
29
|
-
pages() {
|
|
30
|
-
return "pages";
|
|
31
|
-
},
|
|
32
|
-
group(group) {
|
|
33
|
-
return assertTag(`group:${safeSegment(group)}`);
|
|
34
|
-
},
|
|
35
|
-
page(group, slug) {
|
|
36
|
-
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
37
|
-
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
38
|
-
},
|
|
39
|
-
manifest(contentHash) {
|
|
40
|
-
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
41
|
-
},
|
|
42
|
-
sitemap() {
|
|
43
|
-
return "sitemap";
|
|
44
|
-
},
|
|
45
|
-
robots() {
|
|
46
|
-
return "robots";
|
|
47
|
-
},
|
|
48
|
-
llms(scope = "root") {
|
|
49
|
-
return assertTag(`llms:${safeSegment(scope)}`);
|
|
50
|
-
},
|
|
51
|
-
feed(format, scope = "site") {
|
|
52
|
-
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
15
|
|
|
56
|
-
// src/
|
|
57
|
-
var CACHE_CONTROL = "public, max-age=300, s-maxage=3600, stale-while-revalidate=3600, must-revalidate";
|
|
58
|
-
var CDN_CACHE_CONTROL = "public, max-age=3600, stale-while-revalidate=3600, must-revalidate";
|
|
59
|
-
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
60
|
-
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
16
|
+
// src/lib/runtime/response/cached-text-response.ts
|
|
17
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=3600, stale-while-revalidate=3600, must-revalidate", CDN_CACHE_CONTROL = "public, max-age=3600, stale-while-revalidate=3600, must-revalidate", SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate", SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
61
18
|
function cacheControl(policy) {
|
|
62
|
-
|
|
63
|
-
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
64
|
-
return policy;
|
|
19
|
+
return !policy || policy === "default" ? CACHE_CONTROL : policy === "short" ? SHORT_CACHE_CONTROL : policy;
|
|
65
20
|
}
|
|
66
21
|
function cdnCacheControl(policy) {
|
|
67
|
-
|
|
68
|
-
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
69
|
-
return policy;
|
|
22
|
+
return !policy || policy === "default" ? CDN_CACHE_CONTROL : policy === "short" ? SHORT_CDN_CACHE_CONTROL : policy;
|
|
70
23
|
}
|
|
71
24
|
function cachedTextHeaders(contentType, options = {}) {
|
|
72
|
-
|
|
73
|
-
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
74
|
-
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
75
|
-
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
76
|
-
headers.set("content-type", contentType);
|
|
77
|
-
headers.set("x-content-type-options", "nosniff");
|
|
78
|
-
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
79
|
-
return headers;
|
|
25
|
+
let headers = new Headers(options.headers);
|
|
26
|
+
return headers.set("cache-control", cacheControl(options.cachePolicy)), headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy)), headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy)), headers.set("content-type", contentType), headers.set("x-content-type-options", "nosniff"), options.noindex && headers.set("x-robots-tag", "noindex"), headers;
|
|
80
27
|
}
|
|
81
28
|
function createCachedTextResponse(options) {
|
|
82
|
-
|
|
83
|
-
const method = options.method ?? "GET";
|
|
84
|
-
const headers = cachedTextHeaders(options.contentType, options);
|
|
29
|
+
let status = options.status ?? 200, method = options.method ?? "GET", headers = cachedTextHeaders(options.contentType, options);
|
|
85
30
|
return new Response(method === "HEAD" ? null : options.body, {
|
|
86
31
|
headers,
|
|
87
32
|
status
|
|
88
33
|
});
|
|
89
34
|
}
|
|
90
35
|
|
|
91
|
-
// src/
|
|
92
|
-
function canonicalUrl(manifest, path) {
|
|
93
|
-
const origin = manifest.site.url?.replace(/\/+$/, "");
|
|
94
|
-
if (!origin) return path;
|
|
95
|
-
try {
|
|
96
|
-
return new URL(path, `${origin}/`).toString();
|
|
97
|
-
} catch {
|
|
98
|
-
return path;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// src/kernel/routes/metadata/robots.ts
|
|
36
|
+
// src/route-metadata-robots.ts
|
|
103
37
|
async function robotsTxt(manifest) {
|
|
104
38
|
"use cache";
|
|
105
|
-
cacheLife("page")
|
|
106
|
-
cacheTag(tags.site(), tags.robots(), tags.manifest(manifest.contentHash));
|
|
107
|
-
const sitemapUrl = canonicalUrl(manifest, "/sitemap.xml");
|
|
108
|
-
return `User-agent: *
|
|
39
|
+
return cacheLife("page"), cacheTag(tags.site(), tags.robots(), tags.manifest(manifest.contentHash)), `User-agent: *
|
|
109
40
|
Allow: /
|
|
110
|
-
Sitemap: ${
|
|
41
|
+
Sitemap: ${canonicalUrl(manifest, "/sitemap.xml")}
|
|
111
42
|
`;
|
|
112
43
|
}
|
|
113
44
|
function createRobotsTxtRoute(manifest) {
|
|
114
|
-
return async function
|
|
45
|
+
return async function() {
|
|
115
46
|
return createCachedTextResponse({
|
|
116
47
|
body: await robotsTxt(manifest),
|
|
117
48
|
contentType: "text/plain; charset=utf-8"
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { ManifestLike } from '../../../types.js';
|
|
2
1
|
import { MarkdownRouteArtifactManifest } from '../agent/markdown.js';
|
|
3
|
-
import '
|
|
2
|
+
import { M as ManifestLike } from '../../../types-CIwwieNw.js';
|
|
4
3
|
|
|
5
4
|
declare function createSitemapXmlRoute(manifest: ManifestLike): () => Promise<Response>;
|
|
6
5
|
declare function createSitemapMarkdownRoute(manifest: ManifestLike, artifactManifest: MarkdownRouteArtifactManifest): () => Promise<Response>;
|
|
@@ -1,129 +1,61 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/route-metadata-sitemap.ts
|
|
2
|
+
import { tags } from "@publish.os/nextjs/cache/tags";
|
|
2
3
|
import { cacheLife, cacheTag } from "next/cache";
|
|
3
4
|
|
|
4
|
-
// src/
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
function safeSegment(value) {
|
|
13
|
-
const raw = value.trim().toLowerCase() || "root";
|
|
14
|
-
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
15
|
-
const segment = normalized || "root";
|
|
16
|
-
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
17
|
-
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
18
|
-
}
|
|
19
|
-
function assertTag(tag) {
|
|
20
|
-
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
21
|
-
return `tag:${sha256(tag)}`;
|
|
5
|
+
// src/lib/runtime/metadata/canonical-url.ts
|
|
6
|
+
function canonicalUrl(manifest, path) {
|
|
7
|
+
let origin = manifest.site.url?.replace(/\/+$/, "");
|
|
8
|
+
if (!origin) return path;
|
|
9
|
+
try {
|
|
10
|
+
return new URL(path, `${origin}/`).toString();
|
|
11
|
+
} catch {
|
|
12
|
+
return path;
|
|
22
13
|
}
|
|
23
|
-
return tag;
|
|
24
14
|
}
|
|
25
|
-
var tags = {
|
|
26
|
-
site() {
|
|
27
|
-
return "site";
|
|
28
|
-
},
|
|
29
|
-
pages() {
|
|
30
|
-
return "pages";
|
|
31
|
-
},
|
|
32
|
-
group(group) {
|
|
33
|
-
return assertTag(`group:${safeSegment(group)}`);
|
|
34
|
-
},
|
|
35
|
-
page(group, slug) {
|
|
36
|
-
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
37
|
-
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
38
|
-
},
|
|
39
|
-
manifest(contentHash) {
|
|
40
|
-
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
41
|
-
},
|
|
42
|
-
sitemap() {
|
|
43
|
-
return "sitemap";
|
|
44
|
-
},
|
|
45
|
-
robots() {
|
|
46
|
-
return "robots";
|
|
47
|
-
},
|
|
48
|
-
llms(scope = "root") {
|
|
49
|
-
return assertTag(`llms:${safeSegment(scope)}`);
|
|
50
|
-
},
|
|
51
|
-
feed(format, scope = "site") {
|
|
52
|
-
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
15
|
|
|
56
|
-
// src/
|
|
57
|
-
var CACHE_CONTROL = "public, max-age=300, s-maxage=3600, stale-while-revalidate=3600, must-revalidate";
|
|
58
|
-
var CDN_CACHE_CONTROL = "public, max-age=3600, stale-while-revalidate=3600, must-revalidate";
|
|
59
|
-
var SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate";
|
|
60
|
-
var SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
16
|
+
// src/lib/runtime/response/cached-text-response.ts
|
|
17
|
+
var CACHE_CONTROL = "public, max-age=300, s-maxage=3600, stale-while-revalidate=3600, must-revalidate", CDN_CACHE_CONTROL = "public, max-age=3600, stale-while-revalidate=3600, must-revalidate", SHORT_CACHE_CONTROL = "public, max-age=60, s-maxage=600, stale-while-revalidate=300, must-revalidate", SHORT_CDN_CACHE_CONTROL = "public, max-age=300, stale-while-revalidate=3600";
|
|
61
18
|
function cacheControl(policy) {
|
|
62
|
-
|
|
63
|
-
if (policy === "short") return SHORT_CACHE_CONTROL;
|
|
64
|
-
return policy;
|
|
19
|
+
return !policy || policy === "default" ? CACHE_CONTROL : policy === "short" ? SHORT_CACHE_CONTROL : policy;
|
|
65
20
|
}
|
|
66
21
|
function cdnCacheControl(policy) {
|
|
67
|
-
|
|
68
|
-
if (policy === "short") return SHORT_CDN_CACHE_CONTROL;
|
|
69
|
-
return policy;
|
|
22
|
+
return !policy || policy === "default" ? CDN_CACHE_CONTROL : policy === "short" ? SHORT_CDN_CACHE_CONTROL : policy;
|
|
70
23
|
}
|
|
71
24
|
function cachedTextHeaders(contentType, options = {}) {
|
|
72
|
-
|
|
73
|
-
headers.set("cache-control", cacheControl(options.cachePolicy));
|
|
74
|
-
headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
75
|
-
headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy));
|
|
76
|
-
headers.set("content-type", contentType);
|
|
77
|
-
headers.set("x-content-type-options", "nosniff");
|
|
78
|
-
if (options.noindex) headers.set("x-robots-tag", "noindex");
|
|
79
|
-
return headers;
|
|
25
|
+
let headers = new Headers(options.headers);
|
|
26
|
+
return headers.set("cache-control", cacheControl(options.cachePolicy)), headers.set("cdn-cache-control", cdnCacheControl(options.cachePolicy)), headers.set("vercel-cdn-cache-control", cdnCacheControl(options.cachePolicy)), headers.set("content-type", contentType), headers.set("x-content-type-options", "nosniff"), options.noindex && headers.set("x-robots-tag", "noindex"), headers;
|
|
80
27
|
}
|
|
81
28
|
function createCachedTextResponse(options) {
|
|
82
|
-
|
|
83
|
-
const method = options.method ?? "GET";
|
|
84
|
-
const headers = cachedTextHeaders(options.contentType, options);
|
|
29
|
+
let status = options.status ?? 200, method = options.method ?? "GET", headers = cachedTextHeaders(options.contentType, options);
|
|
85
30
|
return new Response(method === "HEAD" ? null : options.body, {
|
|
86
31
|
headers,
|
|
87
32
|
status
|
|
88
33
|
});
|
|
89
34
|
}
|
|
90
35
|
|
|
91
|
-
// src/
|
|
92
|
-
function canonicalUrl(manifest, path) {
|
|
93
|
-
const origin = manifest.site.url?.replace(/\/+$/, "");
|
|
94
|
-
if (!origin) return path;
|
|
95
|
-
try {
|
|
96
|
-
return new URL(path, `${origin}/`).toString();
|
|
97
|
-
} catch {
|
|
98
|
-
return path;
|
|
99
|
-
}
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
// src/kernel/routes/metadata/sitemap.ts
|
|
36
|
+
// src/route-metadata-sitemap.ts
|
|
103
37
|
function xmlEscape(value) {
|
|
104
38
|
return value.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
105
39
|
}
|
|
106
40
|
async function sitemapXml(manifest) {
|
|
107
41
|
"use cache";
|
|
108
|
-
cacheLife("page");
|
|
109
|
-
|
|
110
|
-
const urls = [
|
|
42
|
+
cacheLife("page"), cacheTag(tags.site(), tags.sitemap(), tags.manifest(manifest.contentHash));
|
|
43
|
+
let urls = [
|
|
111
44
|
"/",
|
|
112
45
|
...Object.values(manifest.groups).map((g) => g.path),
|
|
113
46
|
...manifest.pages.filter((page) => page.status === "published").map((page) => page.path)
|
|
114
47
|
];
|
|
115
|
-
const uniqueUrls = [...new Set(urls)];
|
|
116
|
-
const body = uniqueUrls.map(
|
|
117
|
-
(url) => ` <url><loc>${xmlEscape(canonicalUrl(manifest, url))}</loc></url>`
|
|
118
|
-
).join("\n");
|
|
119
48
|
return `<?xml version="1.0" encoding="UTF-8"?>
|
|
120
49
|
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
121
|
-
${
|
|
50
|
+
${[...new Set(urls)].map(
|
|
51
|
+
(url) => ` <url><loc>${xmlEscape(canonicalUrl(manifest, url))}</loc></url>`
|
|
52
|
+
).join(`
|
|
53
|
+
`)}
|
|
122
54
|
</urlset>
|
|
123
55
|
`;
|
|
124
56
|
}
|
|
125
57
|
function createSitemapXmlRoute(manifest) {
|
|
126
|
-
return async function
|
|
58
|
+
return async function() {
|
|
127
59
|
return createCachedTextResponse({
|
|
128
60
|
body: await sitemapXml(manifest),
|
|
129
61
|
contentType: "application/xml; charset=utf-8"
|
|
@@ -131,12 +63,10 @@ function createSitemapXmlRoute(manifest) {
|
|
|
131
63
|
};
|
|
132
64
|
}
|
|
133
65
|
async function sitemapMarkdown(manifest, artifactManifest) {
|
|
134
|
-
|
|
66
|
+
let groups = Object.values(manifest.groups).sort((a, b) => a.path.localeCompare(b.path)).map(
|
|
135
67
|
(group) => `- [${group.title}](${canonicalUrl(manifest, group.path)})`
|
|
136
|
-
)
|
|
137
|
-
|
|
138
|
-
const markdownPath = artifactManifest.byHtmlPath[page.path];
|
|
139
|
-
const markdown = markdownPath ? ` ([Markdown](${canonicalUrl(manifest, markdownPath)}))` : "";
|
|
68
|
+
), pages = manifest.pages.filter((page) => page.status === "published").sort((a, b) => a.path.localeCompare(b.path)).map((page) => {
|
|
69
|
+
let markdownPath = artifactManifest.byHtmlPath[page.path], markdown = markdownPath ? ` ([Markdown](${canonicalUrl(manifest, markdownPath)}))` : "";
|
|
140
70
|
return `- [${page.title}](${canonicalUrl(manifest, page.path)})${markdown}`;
|
|
141
71
|
});
|
|
142
72
|
return [
|
|
@@ -146,14 +76,18 @@ async function sitemapMarkdown(manifest, artifactManifest) {
|
|
|
146
76
|
`- [Full LLMS index](${canonicalUrl(manifest, "/llms-full.txt")})`,
|
|
147
77
|
`- [XML sitemap](${canonicalUrl(manifest, "/sitemap.xml")})`,
|
|
148
78
|
"## Sections",
|
|
149
|
-
groups.length ? groups.join(
|
|
79
|
+
groups.length ? groups.join(`
|
|
80
|
+
`) : `- [Home](${canonicalUrl(manifest, "/")})`,
|
|
150
81
|
"## Pages",
|
|
151
|
-
pages.length ? pages.join(
|
|
82
|
+
pages.length ? pages.join(`
|
|
83
|
+
`) : `- [Home](${canonicalUrl(manifest, "/")})`,
|
|
152
84
|
""
|
|
153
|
-
].join(
|
|
85
|
+
].join(`
|
|
86
|
+
|
|
87
|
+
`);
|
|
154
88
|
}
|
|
155
89
|
function createSitemapMarkdownRoute(manifest, artifactManifest) {
|
|
156
|
-
return async function
|
|
90
|
+
return async function() {
|
|
157
91
|
return createCachedTextResponse({
|
|
158
92
|
body: await sitemapMarkdown(manifest, artifactManifest),
|
|
159
93
|
contentType: "text/markdown; charset=utf-8"
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Metadata } from 'next';
|
|
3
3
|
import { ReactElement } from 'react';
|
|
4
|
-
import { ManifestLike, IndexPageProps } from '../../../types.js';
|
|
5
4
|
import { OgManifestLike } from '../metadata/og-image.js';
|
|
5
|
+
import { M as ManifestLike, I as IndexPageProps } from '../../../types-CIwwieNw.js';
|
|
6
6
|
|
|
7
7
|
type IndexPageComponent = (props: IndexPageProps) => ReactElement | Promise<ReactElement>;
|
|
8
8
|
type GroupRouteConfig = {
|
|
@@ -1,65 +1,13 @@
|
|
|
1
|
-
// src/
|
|
1
|
+
// src/route-page-group.tsx
|
|
2
|
+
import { tags } from "@publish.os/nextjs/cache/tags";
|
|
3
|
+
import { resolveGroup } from "@publish.os/nextjs/resolvers/manifest-resolver";
|
|
2
4
|
import { cacheLife, cacheTag } from "next/cache";
|
|
3
5
|
import { notFound } from "next/navigation";
|
|
4
6
|
|
|
5
|
-
// src/
|
|
6
|
-
|
|
7
|
-
var MAX_TAG_LEN = 256;
|
|
8
|
-
var MAX_SEGMENT_LEN = 80;
|
|
9
|
-
var TAG_PATTERN = /^[a-z0-9:_./-]+$/;
|
|
10
|
-
function sha256(value) {
|
|
11
|
-
return createHash("sha256").update(value).digest("hex").slice(0, 16);
|
|
12
|
-
}
|
|
13
|
-
function safeSegment(value) {
|
|
14
|
-
const raw = value.trim().toLowerCase() || "root";
|
|
15
|
-
const normalized = raw.replace(/\\/g, "/").replace(/\/+/g, "/").replace(/^\//, "").replace(/\/$/, "").replace(/[^a-z0-9:_./-]+/g, "-").replace(/-+/g, "-").replace(/^-|-$/g, "");
|
|
16
|
-
const segment = normalized || "root";
|
|
17
|
-
if (segment.length <= MAX_SEGMENT_LEN) return segment;
|
|
18
|
-
return `${segment.slice(0, 48)}.${sha256(segment)}`;
|
|
19
|
-
}
|
|
20
|
-
function assertTag(tag) {
|
|
21
|
-
if (tag.length > MAX_TAG_LEN || !TAG_PATTERN.test(tag)) {
|
|
22
|
-
return `tag:${sha256(tag)}`;
|
|
23
|
-
}
|
|
24
|
-
return tag;
|
|
25
|
-
}
|
|
26
|
-
var tags = {
|
|
27
|
-
site() {
|
|
28
|
-
return "site";
|
|
29
|
-
},
|
|
30
|
-
pages() {
|
|
31
|
-
return "pages";
|
|
32
|
-
},
|
|
33
|
-
group(group) {
|
|
34
|
-
return assertTag(`group:${safeSegment(group)}`);
|
|
35
|
-
},
|
|
36
|
-
page(group, slug) {
|
|
37
|
-
const path = Array.isArray(slug) ? slug.join("/") : slug;
|
|
38
|
-
return assertTag(`page:${safeSegment(group)}:${safeSegment(path)}`);
|
|
39
|
-
},
|
|
40
|
-
manifest(contentHash) {
|
|
41
|
-
return assertTag(`manifest:${safeSegment(contentHash)}`);
|
|
42
|
-
},
|
|
43
|
-
sitemap() {
|
|
44
|
-
return "sitemap";
|
|
45
|
-
},
|
|
46
|
-
robots() {
|
|
47
|
-
return "robots";
|
|
48
|
-
},
|
|
49
|
-
llms(scope = "root") {
|
|
50
|
-
return assertTag(`llms:${safeSegment(scope)}`);
|
|
51
|
-
},
|
|
52
|
-
feed(format, scope = "site") {
|
|
53
|
-
return assertTag(`feed:${safeSegment(format)}:${safeSegment(scope)}`);
|
|
54
|
-
}
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
// src/internal/utils/logger.ts
|
|
58
|
-
var isDev = process.env.NODE_ENV !== "production";
|
|
59
|
-
var isDebugEnabled = process.env.NEXT_PRIVATE_DEBUG_CACHE === "1";
|
|
60
|
-
var log = {
|
|
7
|
+
// src/lib/runtime/logging/logger.ts
|
|
8
|
+
var isDev = process.env.NODE_ENV !== "production", isDebugEnabled = process.env.NEXT_PRIVATE_DEBUG_CACHE === "1", log = {
|
|
61
9
|
debug(...args) {
|
|
62
|
-
|
|
10
|
+
isDev && isDebugEnabled && console.debug("[publish.os:debug]", ...args);
|
|
63
11
|
},
|
|
64
12
|
info(...args) {
|
|
65
13
|
console.log("[publish.os]", ...args);
|
|
@@ -72,34 +20,10 @@ var log = {
|
|
|
72
20
|
}
|
|
73
21
|
};
|
|
74
22
|
|
|
75
|
-
// src/
|
|
76
|
-
function groupNode(group) {
|
|
77
|
-
return {
|
|
78
|
-
type: "section",
|
|
79
|
-
id: group.key,
|
|
80
|
-
title: group.title,
|
|
81
|
-
path: group.path,
|
|
82
|
-
group: group.key,
|
|
83
|
-
children: group.tree
|
|
84
|
-
};
|
|
85
|
-
}
|
|
86
|
-
function resolveGroup(manifest, group) {
|
|
87
|
-
const groupData = manifest.groups[group];
|
|
88
|
-
if (!groupData) return null;
|
|
89
|
-
return {
|
|
90
|
-
site: manifest.site,
|
|
91
|
-
tree: groupData.tree,
|
|
92
|
-
node: groupNode(groupData),
|
|
93
|
-
currentPath: groupData.path,
|
|
94
|
-
group
|
|
95
|
-
};
|
|
96
|
-
}
|
|
97
|
-
|
|
98
|
-
// src/kernel/routes/pages/agent-metadata.ts
|
|
23
|
+
// src/lib/runtime/metadata/agent-metadata.ts
|
|
99
24
|
function normalizePath(path) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
return prefixed.replace(/\/+$/, "");
|
|
25
|
+
let prefixed = path.startsWith("/") ? path : `/${path}`;
|
|
26
|
+
return prefixed === "/" ? prefixed : prefixed.replace(/\/+$/, "");
|
|
103
27
|
}
|
|
104
28
|
function agentReadableAlternates({
|
|
105
29
|
canonicalPath,
|
|
@@ -115,15 +39,14 @@ function agentReadableAlternates({
|
|
|
115
39
|
};
|
|
116
40
|
}
|
|
117
41
|
|
|
118
|
-
// src/
|
|
119
|
-
function
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
if (/^https
|
|
124
|
-
if (
|
|
125
|
-
|
|
126
|
-
return new URL(path, siteUrl).toString();
|
|
42
|
+
// src/lib/runtime/metadata/social-metadata.ts
|
|
43
|
+
function absoluteUrl({
|
|
44
|
+
path,
|
|
45
|
+
siteUrl
|
|
46
|
+
}) {
|
|
47
|
+
if (/^https?:\/\//i.test(path)) return path;
|
|
48
|
+
if (siteUrl)
|
|
49
|
+
return new URL(path, siteUrl).toString();
|
|
127
50
|
}
|
|
128
51
|
function createSocialMetadata({
|
|
129
52
|
canonicalPath,
|
|
@@ -133,26 +56,20 @@ function createSocialMetadata({
|
|
|
133
56
|
title,
|
|
134
57
|
type = "website"
|
|
135
58
|
}) {
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
title
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}
|
|
154
|
-
const imageUrl = absoluteUrl(entry.url, manifest.site.url);
|
|
155
|
-
return {
|
|
59
|
+
let key = ogManifest?.routes?.[canonicalPath], rootKey = ogManifest?.routes?.["/"], entry = (key ? ogManifest?.entries?.[key] : void 0) ?? (rootKey ? ogManifest?.entries?.[rootKey] : void 0), url = absoluteUrl({ path: canonicalPath, siteUrl: manifest.site.url }), imageUrl = entry ? absoluteUrl({ path: entry.url, siteUrl: manifest.site.url }) : void 0;
|
|
60
|
+
return !entry || !imageUrl ? {
|
|
61
|
+
openGraph: {
|
|
62
|
+
description,
|
|
63
|
+
title,
|
|
64
|
+
type,
|
|
65
|
+
...url ? { url } : {}
|
|
66
|
+
},
|
|
67
|
+
twitter: {
|
|
68
|
+
card: "summary",
|
|
69
|
+
description,
|
|
70
|
+
title
|
|
71
|
+
}
|
|
72
|
+
} : {
|
|
156
73
|
openGraph: {
|
|
157
74
|
description,
|
|
158
75
|
images: [
|
|
@@ -166,7 +83,7 @@ function createSocialMetadata({
|
|
|
166
83
|
siteName: manifest.site.name,
|
|
167
84
|
title,
|
|
168
85
|
type,
|
|
169
|
-
url:
|
|
86
|
+
...url ? { url } : {}
|
|
170
87
|
},
|
|
171
88
|
twitter: {
|
|
172
89
|
card: "summary_large_image",
|
|
@@ -177,33 +94,24 @@ function createSocialMetadata({
|
|
|
177
94
|
};
|
|
178
95
|
}
|
|
179
96
|
|
|
180
|
-
// src/
|
|
97
|
+
// src/route-page-group.tsx
|
|
181
98
|
import { jsx } from "react/jsx-runtime";
|
|
182
|
-
var manifests = /* @__PURE__ */ new Map();
|
|
183
|
-
var indexPages = /* @__PURE__ */ new Map();
|
|
99
|
+
var manifests = /* @__PURE__ */ new Map(), indexPages = /* @__PURE__ */ new Map();
|
|
184
100
|
async function CachedGroupPage({ group }) {
|
|
185
101
|
"use cache";
|
|
186
|
-
cacheLife("page");
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
cacheTag(tags.manifest(manifest.contentHash));
|
|
192
|
-
log.debug("[cache]", group);
|
|
193
|
-
const resolved = resolveGroup(manifest, group);
|
|
194
|
-
if (!resolved) notFound();
|
|
195
|
-
return /* @__PURE__ */ jsx(IndexPage, { ...resolved });
|
|
102
|
+
cacheLife("page"), cacheTag(tags.site(), tags.group(group));
|
|
103
|
+
let manifest = manifests.get(group), IndexPage = indexPages.get(group);
|
|
104
|
+
(!manifest || !IndexPage) && notFound(), cacheTag(tags.manifest(manifest.contentHash)), log.debug("[cache]", group);
|
|
105
|
+
let resolved = resolveGroup(manifest, group);
|
|
106
|
+
return resolved || notFound(), /* @__PURE__ */ jsx(IndexPage, { ...resolved });
|
|
196
107
|
}
|
|
197
108
|
function createGroupPage({
|
|
198
109
|
group,
|
|
199
110
|
manifest,
|
|
200
111
|
IndexPage
|
|
201
112
|
}) {
|
|
202
|
-
manifests.set(group, manifest)
|
|
203
|
-
|
|
204
|
-
return async function Page() {
|
|
205
|
-
log.debug("[render]", group);
|
|
206
|
-
return /* @__PURE__ */ jsx(CachedGroupPage, { group });
|
|
113
|
+
return manifests.set(group, manifest), indexPages.set(group, IndexPage), async function() {
|
|
114
|
+
return log.debug("[render]", group), /* @__PURE__ */ jsx(CachedGroupPage, { group });
|
|
207
115
|
};
|
|
208
116
|
}
|
|
209
117
|
function createGroupMetadata({
|
|
@@ -211,10 +119,7 @@ function createGroupMetadata({
|
|
|
211
119
|
manifest,
|
|
212
120
|
ogManifest
|
|
213
121
|
}) {
|
|
214
|
-
|
|
215
|
-
const title = groupData?.title ?? group;
|
|
216
|
-
const description = manifest.site.description;
|
|
217
|
-
const canonicalPath = groupData?.path ?? `/${group}`;
|
|
122
|
+
let groupData = manifest.groups[group], title = groupData?.title ?? group, description = manifest.site.description, canonicalPath = groupData?.path ?? `/${group}`;
|
|
218
123
|
return {
|
|
219
124
|
title,
|
|
220
125
|
description,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
2
|
import { Metadata } from 'next';
|
|
3
3
|
import { ReactElement, ReactNode } from 'react';
|
|
4
|
+
import { O as OgManifestLike } from '../../../route-metadata-og-image-BeKKFHg7.js';
|
|
4
5
|
import { PageProps, ManifestLike, ResolvedAttribution } from '../../../types.js';
|
|
5
|
-
import { OgManifestLike } from '../metadata/og-image.js';
|
|
6
6
|
|
|
7
7
|
type LeafComponent = (props: PageProps) => ReactElement | Promise<ReactElement>;
|
|
8
8
|
type PoweredByFooterComponent = (props: {
|