Skip to content

Commit

Permalink
Ignore third-party legal files
Browse files Browse the repository at this point in the history
  • Loading branch information
KianNH committed Jan 7, 2025
1 parent fe0ddb4 commit 286519b
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 1 deletion.
6 changes: 6 additions & 0 deletions src/pages/[area]/llms-full.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ export const GET: APIRoute = async ({ params }) => {
const markdown = await getCollection("docs", (e) => {
if (!e.body) return false;

if (
e.slug === "warp-client/legal/3rdparty" ||
e.slug === "magic-wan/legal/3rdparty"
)
return false;

return products.some((p) =>
e.slug.startsWith(p.data.product.url.slice(1, -1)),
);
Expand Down
6 changes: 6 additions & 0 deletions src/pages/[product]/llms-full.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ export async function getStaticPaths() {

export const GET: APIRoute = async ({ props }) => {
const markdown = await getCollection("docs", (e) => {
if (
e.slug === "warp-client/legal/3rdparty" ||
e.slug === "magic-wan/legal/3rdparty"
)
return false;

return (
e.slug.startsWith(props.product.data.product.url.slice(1, -1)) && e.body
);
Expand Down
12 changes: 11 additions & 1 deletion src/pages/llms-full.txt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,17 @@ import type { APIRoute } from "astro";
import { getCollection } from "astro:content";

export const GET: APIRoute = async () => {
const markdown = await getCollection("docs", (e) => e.body)
const markdown = await getCollection("docs", (e) => {
if (!e.body) return false;

if (
e.slug === "warp-client/legal/3rdparty" ||
e.slug === "magic-wan/legal/3rdparty"
)
return false;

return true;
})
.then((entries) =>
entries.map((entry) => {
return [
Expand Down

0 comments on commit 286519b

Please sign in to comment.