Skip to content

Commit 286519b

Browse files
committed
Ignore third-party legal files
1 parent fe0ddb4 commit 286519b

File tree

3 files changed

+23
-1
lines changed

3 files changed

+23
-1
lines changed

src/pages/[area]/llms-full.txt.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,12 @@ export const GET: APIRoute = async ({ params }) => {
3232
const markdown = await getCollection("docs", (e) => {
3333
if (!e.body) return false;
3434

35+
if (
36+
e.slug === "warp-client/legal/3rdparty" ||
37+
e.slug === "magic-wan/legal/3rdparty"
38+
)
39+
return false;
40+
3541
return products.some((p) =>
3642
e.slug.startsWith(p.data.product.url.slice(1, -1)),
3743
);

src/pages/[product]/llms-full.txt.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ export async function getStaticPaths() {
2020

2121
export const GET: APIRoute = async ({ props }) => {
2222
const markdown = await getCollection("docs", (e) => {
23+
if (
24+
e.slug === "warp-client/legal/3rdparty" ||
25+
e.slug === "magic-wan/legal/3rdparty"
26+
)
27+
return false;
28+
2329
return (
2430
e.slug.startsWith(props.product.data.product.url.slice(1, -1)) && e.body
2531
);

src/pages/llms-full.txt.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,17 @@ import type { APIRoute } from "astro";
22
import { getCollection } from "astro:content";
33

44
export const GET: APIRoute = async () => {
5-
const markdown = await getCollection("docs", (e) => e.body)
5+
const markdown = await getCollection("docs", (e) => {
6+
if (!e.body) return false;
7+
8+
if (
9+
e.slug === "warp-client/legal/3rdparty" ||
10+
e.slug === "magic-wan/legal/3rdparty"
11+
)
12+
return false;
13+
14+
return true;
15+
})
616
.then((entries) =>
717
entries.map((entry) => {
818
return [

0 commit comments

Comments
 (0)