From 2b194e90daee0c8e4d1d90f54b4aac48d7a1e28c Mon Sep 17 00:00:00 2001 From: xrendan Date: Mon, 21 Sep 2026 11:11:19 -0600 Subject: [PATCH 1/2] Fix Builder MP SEO: noindex auth pages, promote bills listing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Searching "Builder MP" returned /bills/sign-in instead of the listing. The sign-in page had no metadata and inherited the layout default title, while the listing was titled "Home · Builder MP". - noindex sign-in, unauthorized and bill edit pages - Give the bills listing an absolute Builder MP title, description, keywords and WebApplication JSON-LD; rename H1 to lead with Builder MP - Mention Builder MP in layout descriptions - Raise /bills sitemap priority; disallow /bills/api/ in robots --- src/app/bills/[id]/edit/page.tsx | 6 +++ src/app/bills/layout.tsx | 6 ++- src/app/bills/page.tsx | 53 ++++++++++++++++++++++++--- src/app/bills/sign-in/layout.tsx | 14 +++++++ src/app/bills/unauthorized/layout.tsx | 12 ++++++ src/app/robots.ts | 2 +- src/app/sitemap.ts | 2 +- 7 files changed, 85 insertions(+), 10 deletions(-) create mode 100644 src/app/bills/sign-in/layout.tsx create mode 100644 src/app/bills/unauthorized/layout.tsx diff --git a/src/app/bills/[id]/edit/page.tsx b/src/app/bills/[id]/edit/page.tsx index 74654abc..68d0b873 100644 --- a/src/app/bills/[id]/edit/page.tsx +++ b/src/app/bills/[id]/edit/page.tsx @@ -1,3 +1,4 @@ +import type { Metadata } from "next"; import { redirect } from "next/navigation"; import { getBillByIdFromDB } from "@/app/bills/server/get-bill-by-id-from-db"; import { requireAuthenticatedUser } from "@/app/bills/lib/auth-guards"; @@ -5,6 +6,11 @@ import { BASE_PATH } from "@/app/bills/utils/basePath"; import { Button } from "@/components/ui/button"; import { ReprocessButton } from "@/app/bills/components/ReprocessButton/reprocess-button.component"; +export const metadata: Metadata = { + title: "Edit Bill", + robots: { index: false, follow: false, googleBot: { index: false, follow: false } }, +}; + interface Params { params: Promise<{ id: string }>; } diff --git a/src/app/bills/layout.tsx b/src/app/bills/layout.tsx index 0cdf91f1..27ff291b 100644 --- a/src/app/bills/layout.tsx +++ b/src/app/bills/layout.tsx @@ -15,7 +15,8 @@ export const metadata: Metadata = { default: PROJECT_NAME, template: `%s · ${PROJECT_NAME}`, }, - description: "Understand Canadian Federal Bills", + description: + "Builder MP: Canadian federal bills summarized and judged through a builder-first lens.", openGraph: { type: "website", siteName: PROJECT_NAME, @@ -36,7 +37,8 @@ export const metadata: Metadata = { site: BUILD_CANADA_TWITTER_HANDLE, creator: BUILD_CANADA_TWITTER_HANDLE, title: PROJECT_NAME, - description: "Understand Canadian Federal Bills", + description: + "Builder MP: Canadian federal bills summarized and judged through a builder-first lens.", images: ["https://buildcanada.com/bills/builder-mp-seo-image.png"], }, }; diff --git a/src/app/bills/page.tsx b/src/app/bills/page.tsx index cf088c32..86a8f4d5 100644 --- a/src/app/bills/page.tsx +++ b/src/app/bills/page.tsx @@ -8,7 +8,11 @@ import type { Metadata } from "next"; import { headers } from "next/headers"; import { env } from "@/app/bills/env"; import { buildRelativePath } from "@/app/bills/utils/basePath"; -import { BUILD_CANADA_TWITTER_HANDLE, PROJECT_NAME } from "@/app/bills/consts/general"; +import { + BUILD_CANADA_TWITTER_HANDLE, + BUILD_CANADA_URL, + PROJECT_NAME, +} from "@/app/bills/consts/general"; import FAQModalTrigger from "./FAQModalTrigger"; const CANADIAN_PARLIAMENT_NUMBER = 45; @@ -26,9 +30,11 @@ export const dynamic = "auto"; export const revalidate = 120; // seconds - cache page data export async function generateMetadata(): Promise { - const title = "Home"; + const title = { + absolute: `${PROJECT_NAME} — Canadian Federal Bills Tracker | Build Canada`, + }; const description = - "Understand Canadian federal bills with builder-first analysis."; + "Builder MP tracks every bill before Canada's House of Commons and Senate, summarized and judged through a pro-growth, builder-first lens."; const h = headers(); const headerList = await h; const host = @@ -45,6 +51,14 @@ export async function generateMetadata(): Promise { return { title, description, + keywords: [ + "Builder MP", + "Canadian federal bills", + "Parliament of Canada bills", + "bill tracker Canada", + "45th Parliament", + "Build Canada", + ], alternates: { canonical: pageUrl }, openGraph: { title: PROJECT_NAME, @@ -222,14 +236,41 @@ export default async function Home({ clearMergedBillsCache(); // Allow manual cache busting with ?cache=clear } const bills = await getMergedBillsCached(); + const jsonLd = { + "@context": "https://schema.org", + "@type": "WebApplication", + name: PROJECT_NAME, + alternateName: "Builder MP by Build Canada", + url: `${BUILD_CANADA_URL}${buildRelativePath()}`, + description: + "Builder MP tracks every bill before Canada's House of Commons and Senate, summarized and judged through a pro-growth, builder-first lens.", + applicationCategory: "GovernmentApplication", + operatingSystem: "Web", + isAccessibleForFree: true, + publisher: { + "@type": "Organization", + name: "Build Canada", + url: BUILD_CANADA_URL, + }, + }; return (
+