Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/app/classroom/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Metadata } from "next";

// A church's parent take-home page: rendered in the browser with a generic title, and it repeats lessons that have their own pages.
export const metadata: Metadata = { robots: { index: false, follow: true } };

export default function Layout({ children }: { children: React.ReactNode }) {
return children;
}
8 changes: 8 additions & 0 deletions src/app/external/layout.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
import type { Metadata } from "next";

// Another provider's curriculum shown through Lessons.church: rendered in the browser with a generic title, and the content belongs to that provider.
export const metadata: Metadata = { robots: { index: false, follow: true } };

export default function Layout({ children }: { children: React.ReactNode }) {
return children;
}
8 changes: 8 additions & 0 deletions tests/seo.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ test.describe("SEO", () => {
});
}

// Both render only in the browser behind a generic title; their lessons are indexed on their own pages.
for (const path of ["/classroom/CLS00000001", "/external/provider/program"]) {
test(`${path} is noindex`, async ({ request }) => {
const html = await (await request.get(path)).text();
expect(html).toMatch(/<meta name="robots" content="noindex, follow"/);
});
}

test("search results are noindex", async ({ request }) => {
const html = await (await request.get("/search?q=noah")).text();
expect(html).toMatch(/<meta name="robots" content="noindex/);
Expand Down
Loading