reroute-js 1.0.0-alpha.8 → 1.0.0-alpha.9
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 +2 -0
- package/cli/bin.d.ts +1 -1
- package/cli/bin.js +152 -22
- package/cli/bin.js.map +9 -8
- package/cli/index.d.ts +1 -1
- package/cli/index.js +4 -4
- package/cli/index.js.map +1 -1
- package/cli/src/cli.d.ts +1 -1
- package/cli/src/commands/analyze.d.ts +1 -1
- package/cli/src/commands/build.d.ts +1 -1
- package/cli/src/commands/dev.d.ts +1 -1
- package/cli/src/commands/gen.d.ts +1 -1
- package/cli/src/commands/index.d.ts +1 -1
- package/cli/src/commands/init.d.ts +1 -1
- package/cli/src/commands/lib/assets.d.ts +1 -1
- package/cli/src/commands/lib/bundler.d.ts +1 -1
- package/cli/src/commands/lib/command.d.ts +1 -1
- package/cli/src/commands/lib/env.d.ts +1 -1
- package/cli/src/commands/lib/index.d.ts +1 -1
- package/cli/src/commands/lib/log.d.ts +1 -1
- package/cli/src/commands/lib/markdown/availability.d.ts +1 -1
- package/cli/src/commands/lib/markdown/index.d.ts +1 -1
- package/cli/src/commands/lib/markdown/processor.d.ts +1 -1
- package/cli/src/commands/lib/production.d.ts +1 -1
- package/cli/src/commands/lib/server.d.ts +1 -1
- package/cli/src/commands/lib/streaming/analyzer.d.ts +1 -1
- package/cli/src/commands/lib/streaming/suspense.d.ts +1 -1
- package/cli/src/commands/lib/terminal-ui.d.ts +1 -1
- package/cli/src/commands/lib/theme.d.ts +1 -1
- package/cli/src/commands/lib/version.d.ts +1 -1
- package/cli/src/commands/og.d.ts +1 -1
- package/cli/src/commands/start.d.ts +1 -1
- package/cli/src/index.d.ts +1 -1
- package/core/index.d.ts +1 -1
- package/core/index.js +148 -18
- package/core/index.js.map +9 -8
- package/core/src/bundler/hash.d.ts +1 -1
- package/core/src/bundler/index.d.ts +1 -1
- package/core/src/config.d.ts +26 -2
- package/core/src/config.d.ts.map +1 -1
- package/core/src/content/discovery.d.ts +1 -1
- package/core/src/content/index.d.ts +1 -1
- package/core/src/content/metadata.d.ts +1 -1
- package/core/src/i18n/catalog.d.ts +1 -1
- package/core/src/i18n/discover.d.ts +1 -1
- package/core/src/i18n/index.d.ts +1 -1
- package/core/src/i18n/messages.d.ts +1 -1
- package/core/src/i18n/negotiate.d.ts +1 -1
- package/core/src/i18n/pathname.d.ts +1 -1
- package/core/src/i18n/resolve.d.ts +1 -1
- package/core/src/i18n/types.d.ts +1 -1
- package/core/src/index.d.ts +1 -1
- package/core/src/llms/discovery.d.ts +35 -0
- package/core/src/llms/discovery.d.ts.map +1 -0
- package/core/src/llms/extractor.d.ts +1 -1
- package/core/src/llms/formatter.d.ts +1 -1
- package/core/src/llms/full-generator.d.ts +1 -1
- package/core/src/llms/index-generator.d.ts +1 -1
- package/core/src/llms/index.d.ts +4 -1
- package/core/src/llms/index.d.ts.map +1 -1
- package/core/src/og/discovery.d.ts +1 -1
- package/core/src/og/index.d.ts +1 -1
- package/core/src/og/meta.d.ts +1 -1
- package/core/src/og/render.d.ts +1 -1
- package/core/src/og/types.d.ts +1 -1
- package/core/src/robots/discovery.d.ts +1 -1
- package/core/src/robots/generator.d.ts +1 -1
- package/core/src/robots/generator.d.ts.map +1 -1
- package/core/src/robots/index.d.ts +1 -1
- package/core/src/robots/policies.d.ts +1 -1
- package/core/src/rss/discovery.d.ts +1 -1
- package/core/src/rss/generator.d.ts +1 -1
- package/core/src/rss/index.d.ts +1 -1
- package/core/src/sitemap/discovery.d.ts +1 -1
- package/core/src/sitemap/generator.d.ts +1 -1
- package/core/src/sitemap/index.d.ts +1 -1
- package/core/src/ssr/index.d.ts +1 -1
- package/core/src/ssr/lib/cache.d.ts +1 -1
- package/core/src/ssr/lib/cleanup.d.ts +1 -1
- package/core/src/ssr/lib/collections.d.ts +1 -1
- package/core/src/ssr/lib/compression.d.ts +1 -1
- package/core/src/ssr/lib/compute/content.d.ts +1 -1
- package/core/src/ssr/lib/compute/index.d.ts +1 -1
- package/core/src/ssr/lib/compute/layouts.d.ts +1 -1
- package/core/src/ssr/lib/compute/routes.d.ts +1 -1
- package/core/src/ssr/lib/content-path.d.ts +1 -1
- package/core/src/ssr/lib/data.d.ts +1 -1
- package/core/src/ssr/lib/html.d.ts +1 -1
- package/core/src/ssr/lib/imports.d.ts +1 -1
- package/core/src/ssr/lib/index.d.ts +1 -1
- package/core/src/ssr/lib/layouts.d.ts +1 -1
- package/core/src/ssr/lib/metadata.d.ts +1 -1
- package/core/src/ssr/lib/mime.d.ts +1 -1
- package/core/src/ssr/lib/modules.d.ts +1 -1
- package/core/src/ssr/lib/path.d.ts +1 -1
- package/core/src/ssr/lib/preload.d.ts +1 -1
- package/core/src/ssr/lib/route-match.d.ts +1 -1
- package/core/src/ssr/lib/scripts/collections.d.ts +1 -1
- package/core/src/ssr/lib/scripts/data.d.ts +1 -1
- package/core/src/ssr/lib/scripts/escape.d.ts +1 -1
- package/core/src/ssr/lib/scripts/feeds.d.ts +1 -1
- package/core/src/ssr/lib/scripts/index.d.ts +1 -1
- package/core/src/ssr/lib/seed.d.ts +1 -1
- package/core/src/ssr/lib/serialize.d.ts +1 -1
- package/core/src/ssr/lib/setup.d.ts +1 -1
- package/core/src/ssr/lib/styles.d.ts +1 -1
- package/core/src/ssr/lib/template.d.ts +1 -1
- package/core/src/ssr/lib/types.d.ts +1 -1
- package/core/src/ssr/render.d.ts +1 -1
- package/core/src/ssr/render.d.ts.map +1 -1
- package/core/src/ssr/stream.d.ts +1 -1
- package/core/src/ssr/stream.d.ts.map +1 -1
- package/elysia/index.d.ts +1 -1
- package/elysia/index.js +176 -36
- package/elysia/index.js.map +12 -11
- package/elysia/src/index.d.ts +1 -1
- package/elysia/src/libs/assets.d.ts +1 -1
- package/elysia/src/libs/cache.d.ts +1 -1
- package/elysia/src/libs/caching.d.ts +1 -1
- package/elysia/src/libs/http.d.ts +1 -1
- package/elysia/src/libs/i18n.d.ts +1 -1
- package/elysia/src/libs/image.d.ts +1 -1
- package/elysia/src/libs/index.d.ts +1 -1
- package/elysia/src/libs/llms.d.ts +1 -1
- package/elysia/src/libs/response.d.ts +1 -1
- package/elysia/src/libs/serving.d.ts +1 -1
- package/elysia/src/plugin.d.ts +1 -1
- package/elysia/src/plugin.d.ts.map +1 -1
- package/elysia/src/routes/artifacts.d.ts +1 -1
- package/elysia/src/routes/content.d.ts +1 -1
- package/elysia/src/routes/image.d.ts +1 -1
- package/elysia/src/routes/index.d.ts +1 -1
- package/elysia/src/routes/internal.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts +1 -1
- package/elysia/src/routes/llms.d.ts.map +1 -1
- package/elysia/src/routes/og.d.ts +1 -1
- package/elysia/src/routes/redirects.d.ts +1 -1
- package/elysia/src/routes/robots.d.ts +1 -1
- package/elysia/src/routes/rss.d.ts +1 -1
- package/elysia/src/routes/search.d.ts +1 -1
- package/elysia/src/routes/sitemap.d.ts +1 -1
- package/elysia/src/routes/ssr.d.ts +4 -2
- package/elysia/src/routes/ssr.d.ts.map +1 -1
- package/elysia/src/routes/static.d.ts +1 -1
- package/elysia/src/routes/themeCssRefresh.d.ts +1 -1
- package/elysia/src/types.d.ts +1 -1
- package/package.json +1 -1
- package/react/index.d.ts +1 -1
- package/react/index.js +2 -2
- package/react/index.js.map +1 -1
- package/react/src/components/ClientOnly.d.ts +1 -1
- package/react/src/components/ContentRoute.d.ts +1 -1
- package/react/src/components/Image.d.ts +1 -1
- package/react/src/components/LazyRoute.d.ts +1 -1
- package/react/src/components/Link.d.ts +1 -1
- package/react/src/components/Markdown.d.ts +1 -1
- package/react/src/components/Outlet.d.ts +1 -1
- package/react/src/components/index.d.ts +1 -1
- package/react/src/hooks/index.d.ts +1 -1
- package/react/src/hooks/useContent.d.ts +1 -1
- package/react/src/hooks/useData.d.ts +1 -1
- package/react/src/hooks/useFeed.d.ts +1 -1
- package/react/src/hooks/useLayoutData.d.ts +1 -1
- package/react/src/hooks/useLlms.d.ts +1 -1
- package/react/src/hooks/useNavigate.d.ts +1 -1
- package/react/src/hooks/useParams.d.ts +1 -1
- package/react/src/hooks/useRouter.d.ts +1 -1
- package/react/src/hooks/useSearch.d.ts +1 -1
- package/react/src/hooks/useSearchParams.d.ts +1 -1
- package/react/src/hooks/useToc.d.ts +1 -1
- package/react/src/i18n/LocaleProvider.d.ts +1 -1
- package/react/src/i18n/helpers.d.ts +1 -1
- package/react/src/i18n/index.d.ts +1 -1
- package/react/src/index.d.ts +1 -1
- package/react/src/lib/collection.d.ts +1 -1
- package/react/src/lib/content.d.ts +1 -1
- package/react/src/lib/head.d.ts +1 -1
- package/react/src/lib/index.d.ts +1 -1
- package/react/src/lib/lazy-route.d.ts +1 -1
- package/react/src/lib/route-loader.d.ts +1 -1
- package/react/src/providers/ContentProvider.d.ts +1 -1
- package/react/src/providers/RerouteProvider.d.ts +1 -1
- package/react/src/providers/RouterProvider.d.ts +1 -1
- package/react/src/providers/index.d.ts +1 -1
- package/react/src/types/any.d.ts +1 -1
- package/react/src/types/index.d.ts +1 -1
- package/react/src/types/router.d.ts +1 -1
- package/telemetry/react.d.ts +1 -1
- package/telemetry/react.js +2 -2
- package/telemetry/react.js.map +1 -1
- package/telemetry/server.d.ts +1 -1
- package/telemetry/server.js +25 -10
- package/telemetry/server.js.map +9 -7
- package/telemetry/src/react/api.d.ts +1 -1
- package/telemetry/src/react/context.d.ts +1 -1
- package/telemetry/src/react/index.d.ts +1 -1
- package/telemetry/src/react/telemetry.d.ts +1 -1
- package/telemetry/src/server/context.d.ts +1 -1
- package/telemetry/src/server/headers/extractor.d.ts +1 -1
- package/telemetry/src/server/headers/index.d.ts +1 -1
- package/telemetry/src/server/headers/presets.d.ts +1 -1
- package/telemetry/src/server/index.d.ts +1 -1
- package/telemetry/src/server/instrumentation.d.ts +1 -1
- package/telemetry/src/server/plugin.d.ts +1 -1
- package/telemetry/src/server/sourcemap.d.ts +1 -1
package/README.md
CHANGED
|
@@ -1169,6 +1169,7 @@ Your site now supports:
|
|
|
1169
1169
|
- Accept header content negotiation (`Accept: text/plain`, `Accept: text/markdown`)
|
|
1170
1170
|
- `/llms.txt` - Index of all content: title, description, and link per page
|
|
1171
1171
|
- `/llms-full.txt` - Complete site content in one file (optional; large)
|
|
1172
|
+
- HTML discovery: `Link: rel=alternate` + `<link type="text/markdown">` pointing at the `.md` twin, `Link: rel=llms-txt`, `Vary: Accept`, and `Content-Signal` (also a `Content-Signal:` line in `robots.txt` when robots is enabled)
|
|
1172
1173
|
|
|
1173
1174
|
#### How It Works
|
|
1174
1175
|
|
|
@@ -1201,6 +1202,7 @@ curl -H "Accept: text/html" https://example.com/blog/hello-world # Default
|
|
|
1201
1202
|
- **Flexible exclusions** - Strings, RegExp, or custom functions
|
|
1202
1203
|
- **Works everywhere** - Collections, SSR routes, static pages
|
|
1203
1204
|
- **Auto-discovery** - All content automatically indexed
|
|
1205
|
+
- **Crawler hints** - HTML `Link` / `<link rel="alternate">`, `Content-Signal`, `Vary: Accept`
|
|
1204
1206
|
|
|
1205
1207
|
#### Discovering LLM Files in Your UI
|
|
1206
1208
|
|
package/cli/bin.d.ts
CHANGED
package/cli/bin.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
// @bun
|
|
3
3
|
/**
|
|
4
|
-
* reroute-js v1.0.0-alpha.
|
|
4
|
+
* reroute-js v1.0.0-alpha.9
|
|
5
5
|
*
|
|
6
6
|
* @license MIT
|
|
7
7
|
* @copyright 2026 stewones <hi@stewan.io>
|
|
@@ -68,7 +68,7 @@ async function getVersionString() {
|
|
|
68
68
|
}
|
|
69
69
|
async function getVersion() {
|
|
70
70
|
if (true) {
|
|
71
|
-
return "1.0.0-alpha.
|
|
71
|
+
return "1.0.0-alpha.9";
|
|
72
72
|
}
|
|
73
73
|
const possiblePaths = [
|
|
74
74
|
path.join(import.meta.dir, "../../../../package.json"),
|
|
@@ -86,7 +86,7 @@ async function getVersion() {
|
|
|
86
86
|
}
|
|
87
87
|
async function getCommit() {
|
|
88
88
|
if (true) {
|
|
89
|
-
return "
|
|
89
|
+
return "f5dd5ea";
|
|
90
90
|
}
|
|
91
91
|
return "dev";
|
|
92
92
|
}
|
|
@@ -4208,7 +4208,7 @@ async function renderSSRDocument(options) {
|
|
|
4208
4208
|
if (setup2.metadataResult.statusOverride !== undefined) {
|
|
4209
4209
|
statusOverride = setup2.metadataResult.statusOverride;
|
|
4210
4210
|
}
|
|
4211
|
-
const extraHead = setup2.bundlePreload + setup2.preloadExtraHead;
|
|
4211
|
+
const extraHead = appendLlmsAlternateHead(setup2.bundlePreload + setup2.preloadExtraHead, pathname, statusOverride || 200, config.llms);
|
|
4212
4212
|
const combinedHead = dedent([
|
|
4213
4213
|
dedent(head) || "",
|
|
4214
4214
|
dedent(extraHead),
|
|
@@ -4238,6 +4238,7 @@ async function renderSSRDocument(options) {
|
|
|
4238
4238
|
var init_render = __esm(() => {
|
|
4239
4239
|
init_server2();
|
|
4240
4240
|
init_config();
|
|
4241
|
+
init_discovery3();
|
|
4241
4242
|
init_lib();
|
|
4242
4243
|
init_html();
|
|
4243
4244
|
});
|
|
@@ -4564,6 +4565,112 @@ var init_extractor = __esm(() => {
|
|
|
4564
4565
|
init_render();
|
|
4565
4566
|
});
|
|
4566
4567
|
|
|
4568
|
+
// packages/core/src/llms/discovery.ts
|
|
4569
|
+
function yesNo(value) {
|
|
4570
|
+
return value === false ? "no" : "yes";
|
|
4571
|
+
}
|
|
4572
|
+
function formatContentSignal(policy, whenUndefined = "omit") {
|
|
4573
|
+
if (policy === false)
|
|
4574
|
+
return;
|
|
4575
|
+
if (policy === undefined && whenUndefined === "omit")
|
|
4576
|
+
return;
|
|
4577
|
+
const resolved = {
|
|
4578
|
+
search: true,
|
|
4579
|
+
aiInput: true,
|
|
4580
|
+
aiTrain: true,
|
|
4581
|
+
...policy
|
|
4582
|
+
};
|
|
4583
|
+
return `ai-train=${yesNo(resolved.aiTrain)}, search=${yesNo(resolved.search)}, ai-input=${yesNo(resolved.aiInput)}`;
|
|
4584
|
+
}
|
|
4585
|
+
function markdownTwinPath(pathname) {
|
|
4586
|
+
const path3 = pathname.split("?")[0];
|
|
4587
|
+
if (path3 === "/" || path3 === "")
|
|
4588
|
+
return "/index.md";
|
|
4589
|
+
return `${path3.replace(/\/$/, "")}.md`;
|
|
4590
|
+
}
|
|
4591
|
+
function shouldAdvertiseMarkdownTwin(pathname, llmsConfig) {
|
|
4592
|
+
if (!llmsConfig?.enabled)
|
|
4593
|
+
return false;
|
|
4594
|
+
if (llmsConfig.enableMarkdownExtension === false)
|
|
4595
|
+
return false;
|
|
4596
|
+
if (shouldExcludeRoute(pathname, llmsConfig.excludeRoutes))
|
|
4597
|
+
return false;
|
|
4598
|
+
return true;
|
|
4599
|
+
}
|
|
4600
|
+
function llmsAlternateLinkTag(pathname, llmsConfig) {
|
|
4601
|
+
if (!shouldAdvertiseMarkdownTwin(pathname, llmsConfig))
|
|
4602
|
+
return "";
|
|
4603
|
+
return `<link rel="alternate" type="text/markdown" href="${markdownTwinPath(pathname)}" />`;
|
|
4604
|
+
}
|
|
4605
|
+
function mergeVary(existing, token) {
|
|
4606
|
+
const parts = (existing ?? "").split(",").map((part) => part.trim()).filter(Boolean);
|
|
4607
|
+
if (!parts.some((part) => part.toLowerCase() === token.toLowerCase())) {
|
|
4608
|
+
parts.push(token);
|
|
4609
|
+
}
|
|
4610
|
+
return parts.join(", ");
|
|
4611
|
+
}
|
|
4612
|
+
function appendLinkValues(existing, values) {
|
|
4613
|
+
const current = (existing ?? "").split(",").map((part) => part.trim()).filter(Boolean);
|
|
4614
|
+
for (const value of values) {
|
|
4615
|
+
if (!current.includes(value))
|
|
4616
|
+
current.push(value);
|
|
4617
|
+
}
|
|
4618
|
+
return current.join(", ");
|
|
4619
|
+
}
|
|
4620
|
+
function buildLlmsDiscovery(pathname, llmsConfig) {
|
|
4621
|
+
if (!llmsConfig?.enabled)
|
|
4622
|
+
return null;
|
|
4623
|
+
const linkValues = [];
|
|
4624
|
+
if (shouldAdvertiseMarkdownTwin(pathname, llmsConfig)) {
|
|
4625
|
+
linkValues.push(`<${markdownTwinPath(pathname)}>; rel="alternate"; type="text/markdown"`);
|
|
4626
|
+
}
|
|
4627
|
+
if (llmsConfig.enableIndex !== false) {
|
|
4628
|
+
linkValues.push('</llms.txt>; rel="llms-txt"');
|
|
4629
|
+
}
|
|
4630
|
+
const contentSignal = formatContentSignal(llmsConfig.contentSignal, "default");
|
|
4631
|
+
const vary = llmsConfig.enableContentNegotiation !== false ? "Accept" : undefined;
|
|
4632
|
+
if (linkValues.length === 0 && !contentSignal && !vary)
|
|
4633
|
+
return null;
|
|
4634
|
+
return { linkValues, contentSignal, vary };
|
|
4635
|
+
}
|
|
4636
|
+
function writeHeader(headers2, canonical, value) {
|
|
4637
|
+
const lower = canonical.toLowerCase();
|
|
4638
|
+
if (headers2[lower] !== undefined)
|
|
4639
|
+
headers2[lower] = value;
|
|
4640
|
+
if (headers2[canonical] !== undefined || headers2[lower] === undefined) {
|
|
4641
|
+
headers2[canonical] = value;
|
|
4642
|
+
}
|
|
4643
|
+
}
|
|
4644
|
+
function readHeader(headers2, canonical) {
|
|
4645
|
+
return headers2[canonical] ?? headers2[canonical.toLowerCase()];
|
|
4646
|
+
}
|
|
4647
|
+
function applyLlmsDiscoveryHeaders(headers2, pathname, llmsConfig, status = 200) {
|
|
4648
|
+
if (status < 200 || status >= 300)
|
|
4649
|
+
return;
|
|
4650
|
+
const discovery2 = buildLlmsDiscovery(pathname, llmsConfig);
|
|
4651
|
+
if (!discovery2)
|
|
4652
|
+
return;
|
|
4653
|
+
if (discovery2.linkValues.length > 0) {
|
|
4654
|
+
writeHeader(headers2, "Link", appendLinkValues(readHeader(headers2, "Link"), discovery2.linkValues));
|
|
4655
|
+
}
|
|
4656
|
+
if (discovery2.contentSignal) {
|
|
4657
|
+
writeHeader(headers2, "Content-Signal", discovery2.contentSignal);
|
|
4658
|
+
}
|
|
4659
|
+
if (discovery2.vary) {
|
|
4660
|
+
writeHeader(headers2, "Vary", mergeVary(readHeader(headers2, "Vary"), discovery2.vary));
|
|
4661
|
+
}
|
|
4662
|
+
}
|
|
4663
|
+
function appendLlmsAlternateHead(extraHead, pathname, status, llmsConfig) {
|
|
4664
|
+
if (status !== 200)
|
|
4665
|
+
return extraHead;
|
|
4666
|
+
const tag = llmsAlternateLinkTag(pathname, llmsConfig);
|
|
4667
|
+
return tag ? `${extraHead}
|
|
4668
|
+
${tag}` : extraHead;
|
|
4669
|
+
}
|
|
4670
|
+
var init_discovery3 = __esm(() => {
|
|
4671
|
+
init_extractor();
|
|
4672
|
+
});
|
|
4673
|
+
|
|
4567
4674
|
// packages/core/src/llms/index-generator.ts
|
|
4568
4675
|
var exports_index_generator = {};
|
|
4569
4676
|
__export(exports_index_generator, {
|
|
@@ -5066,6 +5173,7 @@ var init_full_generator = __esm(() => {
|
|
|
5066
5173
|
|
|
5067
5174
|
// packages/core/src/llms/index.ts
|
|
5068
5175
|
var init_llms = __esm(() => {
|
|
5176
|
+
init_discovery3();
|
|
5069
5177
|
init_extractor();
|
|
5070
5178
|
init_full_generator();
|
|
5071
5179
|
init_index_generator();
|
|
@@ -5232,7 +5340,7 @@ async function discoverRobotsData(cwd, isWatchMode, robotsConfig, sitemapConfig,
|
|
|
5232
5340
|
redirectSourcePaths
|
|
5233
5341
|
};
|
|
5234
5342
|
}
|
|
5235
|
-
var
|
|
5343
|
+
var init_discovery4 = () => {};
|
|
5236
5344
|
|
|
5237
5345
|
// packages/core/src/robots/generator.ts
|
|
5238
5346
|
function getEffectivePolicies(policies) {
|
|
@@ -5275,8 +5383,16 @@ function addDisallowDirectives(lines, policy, autoDisallows) {
|
|
|
5275
5383
|
}
|
|
5276
5384
|
}
|
|
5277
5385
|
}
|
|
5278
|
-
function
|
|
5386
|
+
function addContentSignalLine(lines, policy, robotsConfig) {
|
|
5387
|
+
if (policy.userAgent !== "*")
|
|
5388
|
+
return;
|
|
5389
|
+
const value = formatContentSignal(robotsConfig.contentSignal);
|
|
5390
|
+
if (value)
|
|
5391
|
+
lines.push(`Content-Signal: ${value}`);
|
|
5392
|
+
}
|
|
5393
|
+
function addPolicyBlock(lines, policy, autoDisallows, robotsConfig) {
|
|
5279
5394
|
lines.push(`User-agent: ${policy.userAgent}`);
|
|
5395
|
+
addContentSignalLine(lines, policy, robotsConfig);
|
|
5280
5396
|
addAllowDirectives(lines, policy);
|
|
5281
5397
|
addDisallowDirectives(lines, policy, autoDisallows);
|
|
5282
5398
|
if (policy.crawlDelay !== undefined) {
|
|
@@ -5302,7 +5418,7 @@ function generateRobots(discovery2, robotsConfig, sitemapEnabled) {
|
|
|
5302
5418
|
const effectivePolicies = getEffectivePolicies(policies);
|
|
5303
5419
|
const autoDisallows = getAutoDisallows(discovery2);
|
|
5304
5420
|
for (const policy of effectivePolicies) {
|
|
5305
|
-
addPolicyBlock(lines, policy, autoDisallows);
|
|
5421
|
+
addPolicyBlock(lines, policy, autoDisallows, robotsConfig);
|
|
5306
5422
|
}
|
|
5307
5423
|
addGlobalCrawlDelay(lines, crawlDelay, effectivePolicies);
|
|
5308
5424
|
if (customRules) {
|
|
@@ -5314,6 +5430,9 @@ function generateRobots(discovery2, robotsConfig, sitemapEnabled) {
|
|
|
5314
5430
|
`).trim()}
|
|
5315
5431
|
`;
|
|
5316
5432
|
}
|
|
5433
|
+
var init_generator = __esm(() => {
|
|
5434
|
+
init_discovery3();
|
|
5435
|
+
});
|
|
5317
5436
|
|
|
5318
5437
|
// packages/core/src/robots/policies.ts
|
|
5319
5438
|
function blockAICrawlers(crawlers) {
|
|
@@ -5384,7 +5503,8 @@ var init_policies = __esm(() => {
|
|
|
5384
5503
|
|
|
5385
5504
|
// packages/core/src/robots/index.ts
|
|
5386
5505
|
var init_robots = __esm(() => {
|
|
5387
|
-
|
|
5506
|
+
init_discovery4();
|
|
5507
|
+
init_generator();
|
|
5388
5508
|
init_policies();
|
|
5389
5509
|
});
|
|
5390
5510
|
|
|
@@ -5717,7 +5837,7 @@ async function discoverSitemapData(cwd, collections2, baseUrl, isWatchMode, site
|
|
|
5717
5837
|
ssrDataRoutes
|
|
5718
5838
|
};
|
|
5719
5839
|
}
|
|
5720
|
-
var
|
|
5840
|
+
var init_discovery5 = () => {};
|
|
5721
5841
|
|
|
5722
5842
|
// packages/core/src/rss/discovery.ts
|
|
5723
5843
|
import { pathToFileURL as pathToFileURL7 } from "node:url";
|
|
@@ -5985,7 +6105,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
5985
6105
|
}
|
|
5986
6106
|
const ssrDataFeeds = new Map;
|
|
5987
6107
|
const bundledRoutes = globalThis.__REROUTE_ROUTES__;
|
|
5988
|
-
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (
|
|
6108
|
+
const { discoverRoutes: discoverRoutes2 } = await Promise.resolve().then(() => (init_discovery5(), exports_discovery));
|
|
5989
6109
|
const { staticRoutes } = await discoverRoutes2(cwd, isWatchMode);
|
|
5990
6110
|
if (bundledRoutes && Array.isArray(bundledRoutes)) {
|
|
5991
6111
|
const routePromises = staticRoutes.map(async (route) => {
|
|
@@ -6042,7 +6162,7 @@ async function discoverRSSData(cwd, collections2, baseUrl, isWatchMode, rssConfi
|
|
|
6042
6162
|
ssrDataFeeds
|
|
6043
6163
|
};
|
|
6044
6164
|
}
|
|
6045
|
-
var
|
|
6165
|
+
var init_discovery6 = () => {};
|
|
6046
6166
|
|
|
6047
6167
|
// packages/core/src/rss/generator.ts
|
|
6048
6168
|
function generateRSSXML(feed, options = {}) {
|
|
@@ -6155,7 +6275,7 @@ function escapeXml(unsafe) {
|
|
|
6155
6275
|
|
|
6156
6276
|
// packages/core/src/rss/index.ts
|
|
6157
6277
|
var init_rss = __esm(() => {
|
|
6158
|
-
|
|
6278
|
+
init_discovery6();
|
|
6159
6279
|
});
|
|
6160
6280
|
|
|
6161
6281
|
// packages/core/src/sitemap/generator.ts
|
|
@@ -6300,12 +6420,12 @@ function escapeXml2(unsafe) {
|
|
|
6300
6420
|
return unsafe.replace(/&/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """).replace(/'/g, "'");
|
|
6301
6421
|
}
|
|
6302
6422
|
var DEFAULT_MAX_URLS = 50000;
|
|
6303
|
-
var
|
|
6423
|
+
var init_generator2 = () => {};
|
|
6304
6424
|
|
|
6305
6425
|
// packages/core/src/sitemap/index.ts
|
|
6306
6426
|
var init_sitemap = __esm(() => {
|
|
6307
|
-
|
|
6308
|
-
|
|
6427
|
+
init_discovery5();
|
|
6428
|
+
init_generator2();
|
|
6309
6429
|
});
|
|
6310
6430
|
|
|
6311
6431
|
// packages/core/src/ssr/stream.ts
|
|
@@ -6383,15 +6503,16 @@ async function renderSSRDocumentStream(options) {
|
|
|
6383
6503
|
const newAttrs = hasLang ? attrs.replace(/lang\s*=\s*("[^"]*"|'[^']*'|[^\s>]+)/i, `lang="${pageLang}"`) : `${attrs} lang="${pageLang}"`;
|
|
6384
6504
|
return `<html${newAttrs}>`;
|
|
6385
6505
|
});
|
|
6386
|
-
const
|
|
6387
|
-
if (/<title[\s\S]*?<\/title>/i.test(
|
|
6506
|
+
const extraHeadBase = setup2.bundlePreload + setup2.preloadExtraHead + setup2.metadataResult.perPageHead;
|
|
6507
|
+
if (/<title[\s\S]*?<\/title>/i.test(extraHeadBase)) {
|
|
6388
6508
|
headWithLang = headWithLang.replace(/<title[\s\S]*?<\/title>/i, "");
|
|
6389
6509
|
}
|
|
6390
|
-
if (/<meta\s+name\s*=\s*['"]description['"][^>]*>/i.test(
|
|
6510
|
+
if (/<meta\s+name\s*=\s*['"]description['"][^>]*>/i.test(extraHeadBase)) {
|
|
6391
6511
|
headWithLang = headWithLang.replace(/<meta\s+name\s*=\s*['"]description['"][^>]*>/i, "");
|
|
6392
6512
|
}
|
|
6393
|
-
headWithLang = removeOverriddenMetaTags(headWithLang,
|
|
6513
|
+
headWithLang = removeOverriddenMetaTags(headWithLang, extraHeadBase);
|
|
6394
6514
|
const config = await loadConfig(cwd);
|
|
6515
|
+
const extraHead = appendLlmsAlternateHead(extraHeadBase, pathname, statusOverride || 200, config.llms);
|
|
6395
6516
|
const browserTelemetryConfigRaw = config.telemetry?.browser;
|
|
6396
6517
|
const { serializeBrowserTelemetryConfig: serializeBrowserTelemetryConfig2 } = await Promise.resolve().then(() => exports_serialize);
|
|
6397
6518
|
const browserTelemetryConfig = serializeBrowserTelemetryConfig2(browserTelemetryConfigRaw);
|
|
@@ -6649,6 +6770,7 @@ function unescapeHtmlEntities(str) {
|
|
|
6649
6770
|
var init_stream = __esm(() => {
|
|
6650
6771
|
init_server2();
|
|
6651
6772
|
init_config();
|
|
6773
|
+
init_discovery3();
|
|
6652
6774
|
init_lib();
|
|
6653
6775
|
init_html();
|
|
6654
6776
|
init_imports();
|
|
@@ -6691,12 +6813,15 @@ __export(exports_core, {
|
|
|
6691
6813
|
acceptsGzip: () => acceptsGzip,
|
|
6692
6814
|
allowAICrawlers: () => allowAICrawlers,
|
|
6693
6815
|
allowSearchCrawlers: () => allowSearchCrawlers,
|
|
6816
|
+
appendLlmsAlternateHead: () => appendLlmsAlternateHead,
|
|
6694
6817
|
applyIndexTemplate: () => applyIndexTemplate,
|
|
6818
|
+
applyLlmsDiscoveryHeaders: () => applyLlmsDiscoveryHeaders,
|
|
6695
6819
|
basename: () => basename,
|
|
6696
6820
|
blockAICrawlers: () => blockAICrawlers,
|
|
6697
6821
|
blockAITrainingCrawlers: () => blockAITrainingCrawlers,
|
|
6698
6822
|
blockSearchCrawlers: () => blockSearchCrawlers,
|
|
6699
6823
|
buildHeadFromMeta: () => buildHeadFromMeta,
|
|
6824
|
+
buildLlmsDiscovery: () => buildLlmsDiscovery,
|
|
6700
6825
|
buildLocaleCookie: () => buildLocaleCookie,
|
|
6701
6826
|
cleanupPathScopedSSRData: () => cleanupPathScopedSSRData,
|
|
6702
6827
|
clearSSRModuleStores: () => clearSSRModuleStores,
|
|
@@ -6742,6 +6867,7 @@ __export(exports_core, {
|
|
|
6742
6867
|
findOGImageForPath: () => findOGImageForPath,
|
|
6743
6868
|
formatAsMarkdown: () => formatAsMarkdown,
|
|
6744
6869
|
formatAsText: () => formatAsText,
|
|
6870
|
+
formatContentSignal: () => formatContentSignal,
|
|
6745
6871
|
formatMessage: () => formatMessage,
|
|
6746
6872
|
generateAtomXML: () => generateAtomXML,
|
|
6747
6873
|
generateCollectionScripts: () => generateCollectionScripts,
|
|
@@ -6773,6 +6899,7 @@ __export(exports_core, {
|
|
|
6773
6899
|
isThenable: () => isThenable,
|
|
6774
6900
|
join: () => join2,
|
|
6775
6901
|
listContentFiles: () => listContentFiles,
|
|
6902
|
+
llmsAlternateLinkTag: () => llmsAlternateLinkTag,
|
|
6776
6903
|
loadCollections: () => loadCollections,
|
|
6777
6904
|
loadConfig: () => loadConfig,
|
|
6778
6905
|
loadIndexHtml: () => loadIndexHtml,
|
|
@@ -6782,9 +6909,11 @@ __export(exports_core, {
|
|
|
6782
6909
|
localizeHref: () => localizeHref,
|
|
6783
6910
|
looksLikeLocale: () => looksLikeLocale,
|
|
6784
6911
|
lookupMessage: () => lookupMessage,
|
|
6912
|
+
markdownTwinPath: () => markdownTwinPath,
|
|
6785
6913
|
matchRoutePattern: () => matchRoutePattern,
|
|
6786
6914
|
matchRoutes: () => matchRoutes,
|
|
6787
6915
|
mergeLayoutData: () => mergeLayoutData,
|
|
6916
|
+
mergeVary: () => mergeVary,
|
|
6788
6917
|
negotiateLocale: () => negotiateLocale,
|
|
6789
6918
|
normalizePathname: () => normalizePathname,
|
|
6790
6919
|
parseContentPath: () => parseContentPath,
|
|
@@ -6802,6 +6931,7 @@ __export(exports_core, {
|
|
|
6802
6931
|
seedSSRModuleForPath: () => seedSSRModuleForPath,
|
|
6803
6932
|
setGlobalCollections: () => setGlobalCollections,
|
|
6804
6933
|
setGlobalSSRData: () => setGlobalSSRData,
|
|
6934
|
+
shouldAdvertiseMarkdownTwin: () => shouldAdvertiseMarkdownTwin,
|
|
6805
6935
|
shouldExcludeRoute: () => shouldExcludeRoute,
|
|
6806
6936
|
splitTemplate: () => splitTemplate,
|
|
6807
6937
|
ssrCache: () => ssrCache,
|
|
@@ -107188,7 +107318,7 @@ async function getVersionString2() {
|
|
|
107188
107318
|
}
|
|
107189
107319
|
async function getVersion2() {
|
|
107190
107320
|
if (true) {
|
|
107191
|
-
return "1.0.0-alpha.
|
|
107321
|
+
return "1.0.0-alpha.9";
|
|
107192
107322
|
}
|
|
107193
107323
|
const possiblePaths = [
|
|
107194
107324
|
path3.join(import.meta.dir, "../../../package.json"),
|
|
@@ -107205,10 +107335,10 @@ async function getVersion2() {
|
|
|
107205
107335
|
}
|
|
107206
107336
|
async function getCommit2() {
|
|
107207
107337
|
if (true) {
|
|
107208
|
-
return "
|
|
107338
|
+
return "f5dd5ea";
|
|
107209
107339
|
}
|
|
107210
107340
|
return "dev";
|
|
107211
107341
|
}
|
|
107212
107342
|
main();
|
|
107213
107343
|
|
|
107214
|
-
//# debugId=
|
|
107344
|
+
//# debugId=621D582CE8E376F164756E2164756E21
|